Debian Codegraph @

man/unclass_dend.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/nleaves.R
3 \name{unclass_dend}
4 \alias{unclass_dend}
5 \title{unclass an entire dendrogram tree}
6 \usage{
7 unclass_dend(dend, ...)
8 }
9 \arguments{
10 \item{dend}{a dendrogram object}
11
12 \item{...}{not used}
13 }
14 \value{
15 The list which was the dendrogram (but without a class)
16 }
17 \description{
18 unclass all the nodes in a dendrogram tree. (Helps in cases when a dendrapply function was used wrongly)
19 }
20 \examples{
21 # define dendrogram object to play with:
22 hc <- hclust(dist(USArrests[1:3, ]), "ave")
23 dend <- as.dendrogram(hc)
24
25 itself <- function(x) x
26 dend <- dendrapply(dend, itself)
27 unclass(dend) # this only returns a list with
28 # two dendrogram objects inside it.
29 str(dend) # this is a great way to show a dendrogram,
30 # but it doesn't help us understand how the R object is built.
31 str(unclass(dend)) # this is a great way to show a dendrogram,
32 # but it doesn't help us understand how the R object is built.
33 unclass_dend(dend) # this only returns a list
34 # with two dendrogram objects inside it.
35 str(unclass_dend(dend)) # NOW we can more easily understand
36 # how the dendrogram object is structured...
37 }
38 \seealso{
39 \link{nleaves}
40 }