clust_optim: clust_optim

View source: R/090_optim_cust.R

clust_optimR Documentation

clust_optim

Description

clust_optim produces a scree plot with number of cluster at x-axis and total within-cluster sum of squares at y-axis

Usage

clust_optim(
  obj2clust = NULL,
  num_clstrs = seq(5, 50, 5),
  standardise_vars = TRUE,
  ...
)

Arguments

obj2clust

SpatRaster object (or its file name). Each layer is one variable

num_clstrs

Numeric. Optional. Vector with a sequence of number of clusters to check for optimal

standardise_vars

Logical. Optional. If TRUE (default), variables are standardised (mean = 0; sd = 1)

...

Optional. Arguments for kmeans

Details

The 'scree plot method' allows the user to assess how the quality of the K-means clustering improves when increasing the number of clusters. An elbow in the curve indicates the optimal number of clusters. K-means are run with kmeans

Value

A scree plot

Author(s)

Xavier Rotllan-Puig

See Also

PCAs4clust; EFT_clust; kmeans

Examples


dirctry <- paste0(system.file(package='LPDynR'), "/extdata")
variables_noCor <- rm_multicol(dir2process = dirctry,
                               multicol_cutoff = 0.7)
clust_optim(obj2clust = variables_noCor,
            num_clstrs = seq(5, 50, 5))


LPDynR documentation built on Oct. 16, 2023, 5:06 p.m.