View source: R/09_EFTs_custering.R
EFT_clust | R Documentation |
EFT_clust derives the Ecosystem Functional Types using K-means to perform a clustering on the pixels of the SpatRaster object
EFT_clust(
obj2clust = NULL,
n_clust = 20,
standardise_vars = TRUE,
filename = "",
...
)
obj2clust |
SpatRaster object (or its file name). Each layer is one variable |
n_clust |
Numeric. Number of total clusters. Optional. Default = 20 |
standardise_vars |
Logical. Optional. If TRUE (default), variables are standardised (mean = 0; sd = 1) |
filename |
Character. Output filename. Optional |
... |
Arguments for |
kmeans
does not optimize the final number of clusters. It needs to be set by means of 'n_clust'
(default = 20). There are several methods and statistics to determine the optimal number. clust_optim
produces a scree plot to help the user to decide the optimal number of clusters.
EFT_clust passes as default to kmeans
iter.max = 500 and algorithm = "MacQueen", but these can be
modified passing these arguments through '...'
Please note that the variables are standardised (mean = 0; sd = 1) before running the clustering
An evaluation of the clustering is provided together with the SpatRaster object.
It is calculated as model$betweenss / model$totss * 100;
where 'betweenss' and 'totss' are generated by kmeans
A list with two components: (1) a SpatRaster object with the clusters and (2) a vector with the clustering evaluation in percentage
Xavier Rotllan-Puig
PCAs4clust
; clust_optim
; kmeans
dirctry <- paste0(system.file(package='LPDynR'), "/extdata")
variables_noCor <- rm_multicol(dir2process = dirctry,
multicol_cutoff = 0.7)
EFT_clust(obj2clust = variables_noCor,
n_clust = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.