[R] assigning rownames

Thomas Lumley tlumley at u.washington.edu
Fri Nov 14 22:30:07 CET 2003


On Fri, 14 Nov 2003, Liaw, Andy wrote:

> Try something like this:
>
> > m <- matrix(1:6, 3, 2)
> > mName <- "m"
> > eval(substitute(rownames(Name) <- LETTERS[1:3],
> list(Name=as.name(mName))))

Or in R 1.8.0

   mName<-as.name("m")
   eval(bquote( rownames(.(mName))<-LETTERS[1:3]))


	-thomas




More information about the R-help mailing list