cut.twinspan: Return twinspan Classification at Given Level

cut.twinspanR Documentation

Return twinspan Classification at Given Level

Description

Returns a vector of twinspan classes at a given level of hierarchy or classes respecting group heterogeneity for quadrats or species.

Usage

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

twingroup(x, group, what = c("quadrat", "species"))

cuth(x, ngroups, what = c("quadrat", "species"), binname = FALSE)

Arguments

x

twinspan result.

level

Level of hierarchy for classification. If missing, the final level used in the object will be returned.

what

Return either a "quadrat" or "species" classification vector.

binname

Use binary label for classes instead of decimal number.

...

Other parameters (ignored).

group

Group id number.

ngroups

Number of groups.

Details

twinspan returns only the the classification at the final level, but any upper level classes can be found by integer divisions by 2. Function cut returns a vector class id numbers for a given level of classification. Utility function twingroup returns a logical vector that is TRUE for items belonging to a certain group at any level. It can be more practical in subsetting data.

Function cuth cuts the classification by class heterogeneity instead of level, and can be used to implement the modified method of Roleček et al. (2009). The groups are formed with decreasing heterogeneity but respecting the hierarchy. Total chi-square (also known as inertia) is used as the criterion of heterogeneity. The criterion is calculated with twintotalchi and the criterion is based on the same data matrix as internally used in twinspan. The function can also be used for species classification, also with the internally used modified species matrix.

Value

A vector of class numbers for the given level of hierarchy using Twinspan identifiers. For identifiers and levels, see summary.twinspan, as.hclust.twinspan.

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

predict.twinspan gives similar classes, but based on indicator pseudospecies. cutree provides a similar functionality for hclust trees. Function as.hclust.twinspan generates corresponding tree presentation, and plot.twinspan will print that tree labelling internal nodes (divisions).

Examples


data(ahti)
tw <- twinspan(ahti)
cut(tw)
## traditional twinspan classification by level of hierarchy
cut(tw, level=3)
cut(tw, what = "species")
## number of groups as with level=3, but by group heterogeneity
cuth(tw, ngroups = 8)


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