[R] Copying row names

kwaj kingsley.oteng at gmail.com
Fri Sep 14 22:58:18 CEST 2007


I have been trying to copy the row names of one matrix to another matrix but
having difficulty. The original matrix contains a row name which I would
like to replicate in the new matrix. I use the following approach?
The two matrices have identical dimensions.

rN <- row.names(origMatrix)
row.names(newMatrix) <- rN

However the new matrix does not take on the labels. 

I have also tried, 

row.names(newMatrix) <- as.character(rN)

Any ideas?


-- 
View this message in context: http://www.nabble.com/Copying-row-names-tf4445280.html#a12683702
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list