[R] cannot assign dimnames

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.ac.be
Mon Sep 27 16:57:17 CEST 2004


Hi Dan,

try this:

?dimnames
mat <- matrix(rnorm(10*3), 10, 3)
dimnames(mat) <- list(letters[1:10], c("X", "Y", "Z"))
mat

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Dan Bebber" <danbebber at forestecology.co.uk>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, September 27, 2004 4:46 PM
Subject: [R] cannot assign dimnames


> Dear list,
>
> If anyone knows how to assign dimnames to matrices or arrays I would 
> be most
> grateful for help. I've tried various permutations of likely-looking 
> code
> but get error messages every time. I could find no example in the
> documentation.
>
> Many thanks,
> Dan Bebber
>
> Department of Plant Sciences
> University of Oxford
> South Parks Road
> Oxford OX1 3RB
> UK
> Tel. 01865 275000
>
> ______________________________________________
> R-help at 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
>




More information about the R-help mailing list