as.dendrogram.twinspan: Extract Species or Quadrat Dendrograms

as.dendrogram.twinspanR Documentation

Extract Species or Quadrat Dendrograms

Description

Function extracts the species or quadrat classification as a hierarchic dendrogram.

Usage

## S3 method for class 'twinspan'
as.dendrogram(
  object,
  height = c("level", "chi", "eigen"),
  what = c("quadrat", "species"),
  ...
)

Arguments

object

twinspan result object.

height

Use either division levels ("level"), total Chi-squares ("chi") or eigenvalues of first axis ("eigen") of division as dendrogram heights.

what

Return either a "quadrat" or "species" dendrogram.

...

Other parameters to functions.

Details

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.

Value

A dendrogram object.

See Also

as.hclust.twinspan, dendrogram.

Examples


## 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))


jarioksa/twinspan documentation built on Nov. 23, 2024, 2:49 p.m.