Learn R Programming

sits (version 1.12.0)

sits_dendro_bestcut: Compute validity indexes to a range of cut height

Description

Reads a dendrogram object and its corresponding sits tibble and computes the best number of clusters that maximizes the adjusted Rand index.

Usage

sits_dendro_bestcut(data.tb, dendro.obj)

Arguments

data.tb

Tibble used to generate `dendro.obj`.

dendro.obj

Dendrogram object returned from sits_dendrogram.

Value

Vector with the best number of clusters (k) and its respective heigh.

References

Lawrence Hubert and Phipps Arabie. Comparing partitions. Journal of Classification, 2, p.193--218, 1985.

See randIndex for implementation details.

Examples

Run this code
# NOT RUN {
# load a simple data set with two classes
data(cerrado_2classes)
# calculate the dendrogram
dendro.obj <- sits_dendrogram (cerrado_2classes, bands = c("ndvi", "evi"))
# include the cluster info in the sits tibble
sits_dendro_bestcut (cerrado_2classes, dendro.obj)
# }

Run the code above in your browser using DataLab