Re: [R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Sorkin, John
My life is complete. I have inspired a fortune! John From: Rolf Turner Sent: Monday, July 3, 2023 6:34 PM To: Bert Gunter Cc: Sorkin, John; r-help@r-project.org (r-help@r-project.org); Achim Zeileis Subject: Re: [R] Create a variable lenght string that ca

Re: [R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Ebert,Timothy Aaron
At least on my system string has a single value of " xxx1 xxx2" not "xxx1" and "xxx2". The variable zzz has two values: "J K xxx1" and "J K xxx2" What you want is "J", "K", "xxx1", "xxx2" If I cheat everything works. So then the goal is to rewrite the program so cheating is not needed. # cr

Re: [R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Rolf Turner
On Mon, 3 Jul 2023 13:40:41 -0700 Bert Gunter wrote: > I am not going to try to sort out your confusion, as others have > already tried and failed. Fortune nomination!!! cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Stats. Dep't. (secreta

Re: [R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Bert Gunter
I am not going to try to sort out your confusion, as others have already tried and failed. But I will point out that "string" of variables is pretty much nonsense in R. A "character vector"/"vector of strings" is probably what you mean and want to provide column names // names for the second compon

[R] Create a variable lenght string that can be used in a dimnames statement

2023-07-03 Thread Sorkin, John
Colleagues, I am sending this email again with a better description of my problem and the area where I need help. I need help creating a string of variables that will be accepted by the dimnames function. The string needs to start with the dimnames j and k followed by a series of dimnames xxx1

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Rui Barradas
Às 20:55 de 03/07/2023, Rui Barradas escreveu: Às 20:26 de 03/07/2023, Sorkin, John escreveu: Jeff, Again my thanks for your guidance. I replaced dimnames(myvalues)<-list(NULL,c(zzz)) with colnames(myvalues)<-zzz and get the same error, Error in dimnames(x) <- dn :    length of 'dimnames' [2] no

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Rui Barradas
Às 20:26 de 03/07/2023, Sorkin, John escreveu: Jeff, Again my thanks for your guidance. I replaced dimnames(myvalues)<-list(NULL,c(zzz)) with colnames(myvalues)<-zzz and get the same error, Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent It appears that I am cre

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Sorkin, John
Jeff, Again my thanks for your guidance. I replaced dimnames(myvalues)<-list(NULL,c(zzz)) with colnames(myvalues)<-zzz and get the same error, Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent It appears that I am creating the string zzz in a manner that is not compa

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Jeff Newmiller
I really think you should read that help page. colnames() accesses the second element of dimnames() directly. On July 3, 2023 11:39:37 AM PDT, "Sorkin, John" wrote: >Jeff, >Thank you for your reply. >I should have said with dim names not column names. I want the Mateix to have >dim names, no

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Sorkin, John
Jeff, Thank you for your reply. I should have said with dim names not column names. I want the Mateix to have dim names, no row names, dim names j, k, xxx1, xxx2. John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medici

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Rui Barradas
Às 19:00 de 03/07/2023, Sorkin, John escreveu: I am trying to create an array, myvalues, having 2 rows and 4 columns, where the column names are j,k,xxx1,xxx2. The code below fails, with the following error, "Error in dimnames(myvalues) <- list(NULL, zzz) : length of 'dimnames' [2] not equal

Re: [R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Jeff Newmiller
?colnames On July 3, 2023 11:00:32 AM PDT, "Sorkin, John" wrote: >I am trying to create an array, myvalues, having 2 rows and 4 columns, where >the column names are j,k,xxx1,xxx2. The code below fails, with the following >error, "Error in dimnames(myvalues) <- list(NULL, zzz) : > length of '

[R] Create matrix with column names wiht the same prefix xxxx and that end in 1, 2

2023-07-03 Thread Sorkin, John
I am trying to create an array, myvalues, having 2 rows and 4 columns, where the column names are j,k,xxx1,xxx2. The code below fails, with the following error, "Error in dimnames(myvalues) <- list(NULL, zzz) : length of 'dimnames' [2] not equal to array extent" Please help me get the code t

Re: [R] Plotting factors in graph panel

2023-07-03 Thread PIKAL Petr
Hi I believe that facet_grid his is quite close to what you expect. p <- ggplot(mpg, aes(displ, cty)) + geom_point()+geom_line() p + facet_grid(vars(drv), vars(cyl)) You can inspect how mpg data is organized by head(mpg) Cheers Petr > -Original Message- > From: R-help On Behalf Of A

Re: [R] Plotting factors in graph panel

2023-07-03 Thread Anupam Tyagi
Attached is another example plot, that is better than the earlier one. On Mon, 3 Jul 2023 at 15:21, Anupam Tyagi wrote: > I thought maybe I can share with you how the data looks in Excel, and an > example plot I found on the web that looks similar to what I want to plot. > These are attached to

Re: [R] Plotting factors in graph panel

2023-07-03 Thread Anupam Tyagi
Thanks Jim, thanks everyone. I was caught up with work and moving home, so a delay in response. I tried running the code you provided and it is not running well in my R-Studio setup. It is giving errors and not producing plots. I don't yet understand all the code well yet, so I need to work on it a

Re: [R] Help/documentation on Rgui

2023-07-03 Thread Iago Giné Vázquez
Thank you Petr, great! Best, Iago De: PIKAL Petr Enviat: Dilluns, 3-juliol 3e000 2023 9:42 Per a: Iago Gin� V�zquez; r-help@r-project.org Assumpte: RE: Help/documentation on Rgui Hi I am not sure about opening Rgui in terminal but for customising Rgui appearance

Re: [R] Help/documentation on Rgui

2023-07-03 Thread PIKAL Petr
Hi I am not sure about opening Rgui in terminal but for customising Rgui appearance you can modify Rconsole and Rprofile or Rprofile.site which you should find in etc folder of your R installation. https://stat.ethz.ch/R-manual/R-devel/library/utils/html/Rconsole.html https://rdrr.io/r/utils/Rcon