hi all -- i don't know if this is a bug or not, thought i would survey the
crowd before trying to submit a report...

if i specify a cut height for a dendrogram that is higher than the full
dendrogram itself, my expectation is that the $upper value would be NULL or
NA, and the $lower value would be the original dendrogram.
but instead, a cut is forced, typically at just the first (top-level) node
of the dendrogram, even if the node is at a height lower than
that specified in the cut(...) call.

how to replicate:

> x <- matrix(runif(100), ncol = 10)
> y <- as.dendrogram(agnes(x, diss = TRUE))
> y
'dendrogram' with 2 branches and 10 members total, at height 0.556164
> cut(y, 0.6)
$upper
'dendrogram' with 2 branches and 2 members total, at height 0.556164

$lower
$lower[[1]]
'dendrogram' with 2 branches and 7 members total, at height 0.4950002

$lower[[2]]
'dendrogram' with 2 branches and 3 members total, at height 0.4252925


here's the relavant doc section:

     ‘cut.dendrogram()’ returns a list with components ‘$upper’ and
     ‘$lower’, the first is a truncated version of the original tree,
     also of class ‘dendrogram’, the latter a list with the branches
     obtained from cutting the tree, each a ‘dendrogram’.


in the example above, as the cut point is higher than full tree height
itself, i don't believe a cut should be made, and thus i expect $upper to
be empty, and $lower to contain a single entry with the original dendrogram
y.
but maybe my expectation differs from others here?

cheers,

-m

        [[alternative HTML version deleted]]

______________________________________________
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