as.dendrogram.twinspan | R Documentation |
Function extracts the species or quadrat classification as a
hierarchic dendrogram
.
## S3 method for class 'twinspan'
as.dendrogram(
object,
height = c("level", "chi", "eigen"),
what = c("quadrat", "species"),
...
)
object |
|
height |
Use either division levels ( |
what |
Return either a |
... |
Other parameters to functions. |
The dendrogram heights are levels of divisions, total Chi-squares
of divisions and groups, or eigenvalues of divisions depending on
argument height
. Terminal groups have no eigenvalues,
because they were not considered for division. For them the method
uses arbitrary value that for a group of n
units is
proportion (n-1)/n
of the height of mother
division. Chi-squares are evaluated also for terminal groups.
There is no guarantee that eigenvalues or Chi-squares decrease in
divisions, and there may be reversals where lower levels are higher
than their mother groups, and the plotted trees can be messy and
unreadable. Chi-squares decrease more monotonically than
eigenvalues of first axis.
R has a wealth of functions to handle and display
dendrograms. See dendrogram
for general
description. There is even stronger support in packages (for
instance, dendextend).
The terminal groups of twinspan
trees are not binary,
but may have several elements (quadrats, species). In
dendrogram
plots, it is best to set
type="triangle"
for nicer looking trees.
A dendrogram
object.
as.hclust.twinspan
, dendrogram
.
## Large datasets are difficult to show in dendrograms: take only
## Northen Boreal quadrats (from 1 to 87).
data(ahti)
tw <- twinspan(ahti[1:87,])
den <- as.dendrogram(tw)
str(den, max.level = 4)
plot(den, type = "triangle", nodePar = list(lab.cex=0.6, pch=NA))
den <- as.dendrogram(tw, height="chi")
plot(den, type = "triangle", nodePar = list(lab.cex=0.6, pch=NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.