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]

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

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

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

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

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