Skip to content

how to extract row& col names from a matrix

3 messages · shanmuha boopathy, Kristel Joossens, vincent@7d4.com

#
You mean somthing like the following?
cat("(");cat(rownames(a),sep=",");cat(")")
cat("(");cat(colnames(a),sep=",");cat(")")

Best regrads,
Kristel
shanmuha boopathy wrote:

  
    
#
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);