[R] ROWNAMES error message
andy_liaw at merck.com
Tue Mar 21 20:37:09 CET 2006
The object to be assigned as rownames need to be a vector, not a data frame.
Try something like:
rownames(SAMPLES) <- GENE_NAMES[]
Also, don't confuse a data frame from a matrix: They are very different.
From: mark salsburg
> I am getting an error message, which I do not know the source to.
> I have a matrix SAMPLES that has preexisting rownames that I
> would like to change. GENE_NAMES contains these rownames.
> > rownames(SAMPLES) = GENE_NAMES
> Error in "dimnames<-.data.frame"(`*tmp*`, value =
> list(list(V1 = c(3843, :
> invalid 'dimnames' given for data frame
> > dim(SAMPLES)
>  12626 20
> > dim(GENE_NAMES)
>  12626 1
> > is.data.frame(SAMPLES)
>  TRUE
> > is.data.frame(GENE_NAMES)
>  TRUE
> I have tried converting GENE_NAMES to a factor, R will not
> allow me because its says "x must be atomic"
> ANY IDEAS??
> Thank you
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help