| sits_cluster_dendro {sits} | R Documentation |
Takes a SITS tibble and produces a sits tibble with an added "cluster" column. This is done in several steps: 1. Calculation of the dendrogram; 2. Get validity index for best cluster using the adjusted Rand Index; 3. Cut the dendrogram using the chosen validity index.
sits_cluster_dendro( samples = NULL, bands = NULL, dist_method = "dtw_basic", linkage = "ward.D2", k = NULL, colors = "RdYlGn", .plot = TRUE, ... )
samples |
A tibble with input set of time series |
bands |
Bands to be used in the clustering |
dist_method |
String with one of the supported distances. |
linkage |
String with agglomeration method to be used. Can be any 'hclust' method (see 'hclust'). Default is 'ward.D2'. |
k |
Desired number of clusters (overrides default value) |
colors |
Color scheme as per .sits_brewer_color_name' function. |
.plot |
Plot the dendrogram? |
... |
Additional parameters to be passed to dtwclust::tsclust() function. |
A tibble with the clusters or clusters' members.
Rolf Simoes, rolf.simoes@inpe.br
"dtwclust" package (https://CRAN.R-project.org/package=dtwclust)
## Not run:
# Load the "dtwclust" package
# library(dtwclust)
# load a simple data set with two classes
data(cerrado_2classes)
# calculate the dendrogram and the best clusters
clusters <- sits_cluster_dendro(cerrado_2classes, bands = c("NDVI", "EVI"))
## End(Not run)