[R] how to extract row& col names from a matrix

vincent@7d4.com vincent at 7d4.com
Tue Dec 6 11:05:40 CET 2005


shanmuha boopathy a écrit :

 >    a<-matrix(1:6,2)
 >  ro<-c("aa","bb")
 >  co<-c("dd","ee","ff")
 >  dimnames(a)<-list(ro,co)

(Not sure I fully understand the question), but :
rn = rownames(a);
cn = colnames(a);




More information about the R-help mailing list