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.

Actually, this is used extensively in tabulations, and is the main
reason for the existence of 1D-arrays (there's no way to name the names
on an ordinary vector).

> str(with(airquality,table(Month)))
 'table' int [1:5(1d)] 31 30 31 31 30
 - attr(*, "dimnames")=List of 1
  ..$ Month: chr [1:5] "5" "6" "7" "8" ...

> with(airquality,table(Month))
Month
 5  6  7  8  9
31 30 31 31 30


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
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.

Reply via email to