twinid | R Documentation |
Twinspan returns the classification topology as a
single integer vector. These functions find similar
classification identifiers for each sampling unit, or
cut
that vector for a lower number of classes.
twinid(hclust, ...)
## S3 method for class 'twinid'
cut(x, level, binname = FALSE, ...)
hclust |
Cluster Analysis result compatible with
|
... |
Other parameters to functions (ignored). |
x |
Vector of classification IDs from |
level |
Level of hierarchy of classification. If missing, level used in the object will be returned. |
binname |
Use binary labels instead of decimal class numbers. |
Twinspan expresses the topology of cluster tree as an
integer. When a cluster z
is split into two, its
daughters will be 2z
and 2z+1
, and its
parent cluster is found with integer division z/2
. The
classification vector only stores the topology of the trees,
and has no information on heights.
twinspan
will not split small clusters and only
proceeds to a defined depth of divisions. In contrast,
twinind
proceeds to each terminal unit (leaf, sampling
unit, quadrat) and these will all have unique
identifiers. With cut
function you can restrict the
identifiers to certain level of classification similarly as in
twinspan
(see cut.twinspan
).
Vector of class "twinid"
giving
twinspan
id of each sampling unit.
If the classification is deep and has many (> 30) levels of hierarchy, the identifiers can exceed the integer maximum in R, and leaves may have non-unique identifiers, and may not recover the correct topoloty. However, they may still be unique beyond this limit, but the user should check this after getting a warning.
data(ahti)
cl <- hclust(dist(ahti, "manhattan"), "average")
(id <- twinid(cl))
cut(id, 6)
table(cut(id, 6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.