rom: Jeff Newmiller
Sent: Monday, July 3, 2023 2:45 PM
To: Sorkin, John
Cc: r-help@r-project.org
Subject: Re: [R] Create matrix with column names wiht the same prefix
and that end in 1, 2
I really think you should read that help page. colnames() accesses
the second element of dimnames() di
aste("j","k",string)
zzz
# assign column names, j, k, xxx1, xxx2 to the matrix
# create column names, j, k, xxx1, xxx2.
dimnames(myvalues)<-list(NULL,c(zzz))
colnames(myvalues)<-zzz
From: Jeff Newmiller
Sent: Monday, July 3, 2023
umn names, j, k, xxx1, xxx2 to the matrix
# create column names, j, k, xxx1, xxx2.
dimnames(myvalues)<-list(NULL,c(zzz))
colnames(myvalues)<-zzz
From: Jeff Newmiller
Sent: Monday, July 3, 2023 2:45 PM
To: Sorkin, John
Cc: r-help@r-project.org
Subj
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
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
À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
?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 '
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
8 matches
Mail list logo