Re: [R] Adding row name to dataframe

2010-09-26 Thread Pedersen Jon
roject.org Cc: tim_cl...@nps.gov Subject: [R] Adding row name to dataframe Dear all, I am trying to add a value to a dataframe and name the row with a number.  I have tried row.name, rowname, and attr(x,"row.names") but none seem to work.  It seems like it should be simple, so not sur

Re: [R] Adding row name to dataframe

2010-09-26 Thread Michael Bedward
Hello Tim, Either of these variations on your example should work... rownames(xy)[11] <- 12 rownames(xy)[11] <- "12" It's just like assigning values to any character vector, so you can also do things like... rownames(xy) <- a.vector.of.all.the.row.names rownames(xy)[1:10] <- paste("foo", 1:10,

[R] Adding row name to dataframe

2010-09-26 Thread Tim Clark
Dear all, I am trying to add a value to a dataframe and name the row with a number.  I have tried row.name, rowname, and attr(x,"row.names") but none seem to work.  It seems like it should be simple, so not sure why I can't get it to work.  Any suggestions? Thanks, Tim x<-seq(1,20,2) y<-s