On 26/07/10 19:01, Michael Lachmann wrote:
Hi,
R seems to have a feature that isn't used much, which I don't really
now how to call. But, the dimnames function, can in addition to giving
names to rows/columns/dim 3 rows/dim 4 rows... can also give labels to
the dimensions themselves.
Thus, I can do:
A = matrix(1:9,3,3)
dimnames(A) = list(from=c(), to=c() )
If you just want to set the names of the dimnames, just do
names(dimnames(A)) <- c("from", "to")
Remember that dimnames is a list and all lists have names.
Allan
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.