| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/depth.R |
| 3 |
\name{min_depth} |
| 4 |
\alias{min_depth} |
| 5 |
\alias{max_depth} |
| 6 |
\title{Find minimum/maximum depth of a dendrogram} |
| 7 |
\usage{ |
| 8 |
min_depth(dend, ...) |
| 9 |
|
| 10 |
max_depth(dend, ...) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{dend}{Any nested list object (including \link{dendrogram}).} |
| 14 |
|
| 15 |
\item{...}{unused at the moment.} |
| 16 |
} |
| 17 |
\value{ |
| 18 |
Integer, the (min/max) number of nodes from the root to the leafs |
| 19 |
} |
| 20 |
\description{ |
| 21 |
As the name implies. This can also work for non-dendrogram nested lists. |
| 22 |
} |
| 23 |
\examples{ |
| 24 |
|
| 25 |
hc <- hclust(dist(USArrests), "ave") |
| 26 |
(dend1 <- as.dendrogram(hc)) # "print()" method |
| 27 |
is.list(dend1) |
| 28 |
is.list(dend1[[1]][[1]][[1]]) |
| 29 |
dend1[[1]][[1]][[1]] |
| 30 |
plot(dend1) |
| 31 |
min_depth(dend1) |
| 32 |
max_depth(dend1) |
| 33 |
} |