Re: [R] convert matrix to dataframe with repeating row names

2008-10-20 Thread Richard . Cotton
> > The row names on a data frame should be unique. You can try > > as.data.frame(xx, row.names=FALSE) to convert zz to be a data frame. If > > you need the row name information, add it as a column in the data frame, > > e.g. mydataframe$rnames <- rownames(zz). (Note to R-Core: the > > document

Re: [R] convert matrix to dataframe with repeating row names

2008-10-20 Thread Prof Brian Ripley
On Mon, 20 Oct 2008, [EMAIL PROTECTED] wrote: I have a matrix x with repeating row names. zz<-matrix(0,4,4) rownames(zz)=c("a","a","b","b") data.frame(zz) (?) The row names on a data frame should be unique. You can try as.data.frame(xx, row.names=FALSE) to convert zz to be a data frame.

Re: [R] convert matrix to dataframe with repeating row names

2008-10-20 Thread Richard . Cotton
> I have a matrix x with repeating row names. > zz<-matrix(0,4,4) > > rownames(zz)=c("a","a","b","b") > > data.frame(zz) (?) The row names on a data frame should be unique. You can try as.data.frame(xx, row.names=FALSE) to convert zz to be a data frame. If you need the row name information

[R] convert matrix to dataframe with repeating row names

2008-10-20 Thread Ravi S. Shankar
Hi R, I have a matrix x with repeating row names. > dim(x) [1] 862 19 zz<-matrix(0,4,4) rownames(zz)=c("a","a","b","b") data.frame(zz) (?) I need to use x in a linear regression lm(as.formula(paste("final_dat[,5]~",paste(colnames(x),collapse="+"))),x ) this gives me a error