[R] Solved: was names(dist(mat)) gives NULL in R 2.1.0

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu May 5 17:16:55 CEST 2005


On Thu, 5 May 2005, Elio Mineo wrote:

> Thanks to Andy Liaw to suggest me the right solution (at least for me):
>
> attributes(dist(mat))$Labels
>
> or
>
> attr(dist(mat),"Labels")

R 2.2.0 will allow labels(dist_object), which seem natural (and unlike 
names promises nothing about the returned object).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list