cut.tw: Cut a TWINSPAN tree into groups of data

Description Usage Arguments Details Value Author(s)

Description

Cut a TWINSPAN tree into groups of data

Usage

1
2
## S3 method for class 'tw'
cut(x, level = NULL, clusters = NULL, long.output = F, ...)

Arguments

x

Object of the class 'tw' created by the function twinspan.

level

The hierarchical level at which the tree should be cut (default is NULL - the level will be set up according to maximum number of levels created by twinspan). Works for both standard and modified TWINSPAN, but differs in behaviour (see Details).

clusters

Number of resulting clusters (only for results of modified TWINSPAN).

long.output

Logical - should the output contain only vector with group assignment (FALSE), or also additional information (TRUE)?

...

Arguments passed to default cut function. Not implemented here.

Details

Argument level can be used for results of both standard and modified TWINSPAN, while argument clusters is applicable only on results of modified TWINSPAN. In the case of modified TWINSPAN the behavior of level and clusters differ - the first indicates at which hierarchical level the resulting tree is cut, while the second says how many final groups should be recognized. Since in modified TWINSPAN there is one division at each hierarchical level, the relationship between level and clusters is level + 1 = clusters.

In case of standard TWINSPAN, number of resulting clusters depends not only on hierarchical level of cutting, but also on other stopping criteria (mainly min.group.size). Number of groups =< 2^level.

Value

If long.output = FALSE returns a vector of the same length as number of samples with assignement of sample into clusters. If long.output = TRUE, output is a data.frame with three columns:

Author(s)

David Zeleny (zeleny.david@gmail.com)


zdealveindy/twinspanR documentation built on March 13, 2021, 8:35 a.m.