as.hclust.twinspan: Extract twinspan Grouping as Hierarchical Cluster Tree

as.hclust.twinspanR Documentation

Extract twinspan Grouping as Hierarchical Cluster Tree

Description

Function extracts classification as an hclust object. The terminal items are the final groups, but quadrats or species are not shown: hclust cannot handle polytomies that are needed to display group members. Use as.dendrogram to show the single items. The group ID number and number of items in the terminal group are used as group names and are displayed in plots.

Usage

## S3 method for class 'twinspan'
as.hclust(
  x,
  height = c("level", "chi"),
  what = c("quadrat", "species"),
  binname = FALSE,
  ...
)

Arguments

x

twinspan result object.

height

Use either division levels ("level") or total Chi-squares of division ("chi") as heights of internal nodes in the tree.

what

Extract "quadrat" or "species" classification tree.

binname

Use binary labels for classes instead of decimal numbers.

...

Other parameters to the function (ignored).

Details

Function can return either a tree showing the twinspan hierarchy or showing the heterogeneity of each group or division. In the first case, all divisions and groups at a certain level of hierarchy are at the same height, but in the latter the divisions are at the height defined by their heterogeneity. The criterion of heterogeneity is the total chi-square (also known as inertia) of the matrix that twinspan internally uses in that division (see twintotalchi). This tree gives the visual presentation of the modified method of Roleček et al. (2009).

When tree heights are based on heterogeneity, subgroups can be more heterogeneous than their parent group. These appear as reversed branches in the tree. A warning is issued for each such case.

Value

an hclust object amended with labels for internal nodes (nodelabels).

References

Roleček, J, Tichý, L., Zelený, D. & Chytrý, M. (2009). Modified TWINSPAN classification in which the hierarchy respects cluster heterogeneity. J Veg Sci 20: 596–602.

See Also

as.dendrogram.twinspan provides an alternative which also shows the sampling units (quadrats or species). The result is based hclust and can be handled with its support functions. plot.twinspan, image.twinspan display the tree. Function cut.twinspan cuts the tree by a level of hierarchy, and cuth by heterogeneity for original sampling units (quadrats, species).

Examples


data(ahti)
tw <- twinspan(ahti)
plot(as.hclust(tw, what = "species"))
cl <- as.hclust(tw)
## plot and 8 groups by hierarchy level
plot(cl)
rect.hclust(cl, 8)
## plot and 8 groups by heterogeneity
cl <- as.hclust(tw, height="chi")
plot(cl)
rect.hclust(cl, 8)




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