kmeans_gcms | R Documentation |
This function performs k-means clustering on a distance matrix and produces a scatter plot of the resulting clusters.
kmeans_gcms(
s,
var_names = c("bio_1", "bio_12"),
study_area = NULL,
scale = TRUE,
k = 3,
method = NULL
)
s |
A list of stacks of General Circulation Models (GCMs). |
var_names |
Character. A vector of names of the variables to include, or 'all' to include all variables. |
study_area |
An Extent object, or any object from which an Extent object can be extracted. Defines the study area for cropping and masking the rasters. |
scale |
Logical. Should the data be centered and scaled? Default is |
k |
Integer. The number of clusters to create. |
method |
Character. The method for distance matrix computation. Default is "euclidean." Possible values are:
"euclidean," "maximum," "manhattan," "canberra," "binary," or "minkowski." If |
A scatter plot showing the resulting clusters and the suggested GCMs.
Luíz Fernando Esser (luizesser@gmail.com) https://luizfesser.wordpress.com
transform_gcms
flatten_gcms
var_names <- c("bio_1", "bio_12")
s <- import_gcms(system.file("extdata", package = "chooseGCM"), var_names = var_names)
study_area <- terra::ext(c(-80, -30, -50, 10)) |> terra::vect(crs="epsg:4326")
kmeans_gcms(s, var_names, study_area, k = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.