[R] hclust doesn't return merge details
Thomas W Blackwell
tblackw at umich.edu
Mon Nov 3 19:54:29 CET 2003
Arne -
I have carried out exactly your example below, and I
get hc$merge as a matrix with two columns and 15 rows.
Do str(hc) to see a useful representation of the
contents of the returned list. help("hclust") describes
this list in the section "Value:". help("Subscript")
shows the various syntactic forms that will extract one
element from a list, but doesn't say quite as explicitly
as one might wish that hc[["merge"]] or hc[[1]] is
the way to return just element "merge" from the list.
Brian Ripley may correct me if I am wrong, but I think
there have never been 'extractor' functions for the
return value from hclust() as there are for lm().
- tom blackwell - u michigan medical school - ann arbor -
On Mon, 3 Nov 2003, Arne Neumann wrote:
> Dear R-users,
>
> I tried to receive the merge details of a clustering by using the
> summary function of hclust.
> For illustration I use the Longley data as done by Prof Ripley (Wed 11
> Apr 2001)
> d <- dist(longley.y)
> d <- d/max(d)
> hc <- hclust(d, "ave")
>
> But instead of getting a matrix for $merge I get:
> >summary(hc)
> Length Class Mode
> merge 30 -none- numeric
> height 15 -none- numeric
> order 16 -none- numeric
> labels 0 -none- NULL
> method 1 -none- character
> call 3 -none- call
> dist.method 1 -none- character
>
> Am I missing something?
> Arne Neumann
>
> > R.version
> platform i386-pc-mingw32
> arch i386
> os mingw32
> system i386, mingw32
> status
> major 1
> minor 7.1
> year 2003
> month 06
> day 16
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
More information about the R-help
mailing list