Learn R Programming

sits (version 1.12.0)

sits_dendrogram: Compute a dendrogram using hierarchical clustering

Description

Cluster time series in hierarchical mode. Hierarchical clustering, as its name suggests, is an algorithm that tries to create a hierarchy of groups in which, as the level in the hierarchy increases, clusters are created by merging the clusters from the next lower level, such that an ordered sequence of groupings is obtained. The similarity measure used to group time series in a cluster is the dtw metric. The procedure is deterministic, so it will always give the same result for a chosen set of similarity measures (see tsclust).

Usage

sits_dendrogram(data.tb, bands = NULL, dist_method = "dtw_basic",
  linkage = "ward.D2", ...)

Arguments

data.tb

Tibble with time series data and metadata to be used to generate the dendrogram.

bands

Vector of bands to be clustered.

dist_method

String with one of the supported distance from proxy's dist, e.g. TWDTW.

linkage

String with agglomeration method to be used. Can be any `hclust` method (see `hclust`). Default is 'ward.D2'.

...

Any additional parameters to be passed to dtwclust::tsclust() function.

Value

A full dendrogram tree for data analysis.

References

`dtwclust` package (https://CRAN.R-project.org/package=dtwclust)

Examples

Run this code
# NOT RUN {
# Load the "dtwclust" package
library (dtwclust)
# load a simple data set with two classes
data(cerrado_2classes)
# calculate the dendrogram
dendro <- sits_dendrogram (cerrado_2classes, bands = c("ndvi", "evi"))
# plot the dendrogram
sits_plot_dendrogram (cerrado_2classes, dendro)
# }

Run the code above in your browser using DataLab