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

From: Kristel Joossens <kristel.joossens_at_econ.kuleuven.be>
Date: Tue 06 Dec 2005 - 21:02:24 EST

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

Best regrads,
Kristel

shanmuha boopathy wrote:
> Dear all,
> I like to extract row names & column names from the named matrix......
>
> like......
>
> a<-matrix(1:6,2)
> ro<-c("aa","bb")
> co<-c("dd","ee","ff")
> dimnames(a)<-list(ro,co)

> a
>
> >
> dd ee ff
> aa 1 3 5
> bb 2 4 6
>
> from the above matrix "a"
> I like to extract
> rownames separately like rownames(a)= (aa,bb)
> column names separately like col names(a)= (dd,ee,ff)
>
> Kindly suggest me some good ways.......
>
> tha´nk you all
>
> with regards,
> boopathy.
>
>
>
>
> Thirumalai Shanmuha Boopathy,
> Zimmer no : 1109,
> Rütscher strasse 165,
> 52072 Aachen .
> Germany.
>
> Home zone : 0049 - 241 - 9813409
> Mobile zone : 0049 - 176 - 23567867
>
>
>
>
>
>
> ---------------------------------
>
> Single? There's someone we'd like you to meet.
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
__________________________________________
Kristel Joossens        Ph.D. Student
Research Center ORSTAT  K.U. Leuven
Naamsestraat 69         Tel: +32 16 326929
3000 Leuven, Belgium    Fax: +32 16 326732
E-mail:  Kristel.Joossens@econ.kuleuven.be
http://www.econ.kuleuven.be/public/ndbae49

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Dec 06 21:24:51 2005

This archive was generated by hypermail 2.1.8 : Tue 06 Dec 2005 - 23:38:35 EST