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

2023-07-04 Thread avi.e.gross
Interesting to read all the answers. Personally, I was a bit irked to see that using a combination of assignments using rownames() and colnames() did not work as one canceled what the other had done. But it turns out if we listed to what John really wanted versus what he said he wanted, then a fai

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