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

2023-07-04 Thread avi.e.gross
lf Of Sorkin, John Sent: Tuesday, July 4, 2023 12:17 AM To: Rolf Turner ; Bert Gunter Cc: r-help@r-project.org (r-help@r-project.org) ; Achim Zeileis Subject: Re: [R] Create a variable lenght string that can be used in a dimnames statement My life is complete. I have inspired a fortune! John

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

2023-07-04 Thread Ivan Krylov
(Sorry for the double post.) On Tue, 4 Jul 2023 10:14:43 +0300 Ivan Krylov wrote: > Try replacing the _second_ paste() in the example above with a c(). What I had forgotten to mention is that you also need to replace the initial assignment > string="" with the following: string = charact

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

2023-07-04 Thread Ivan Krylov
On Mon, 3 Jul 2023 20:08:06 + "Sorkin, John" wrote: > # create variable names xxx1 and xxx2. > string="" > for (j in 1:2){ > name <- paste("xxx",j,sep="") > string <- paste(string,name) > print(string) > } > # Creation of xxx1 and xxx2 works > string You need to distinguish between a s

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

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

2023-07-03 Thread Ebert,Timothy Aaron
c("j","k",string) # assign column names, j, k, xxx1, xxx2 to the matrix # create column names, j, k, xxx1, xxx2. dimnames(myvalues)<-list(NULL,c(zzz)) Regards, Tim -Original Message- From: R-help On Behalf Of Sorkin, John Sent: Monday, July 3, 2023 4:08 PM T

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