pca_raster | R Documentation |
pca_raster performs a principal component analysis with a set of variables and returns results including PCs as raster layers. If needed, principal components can be projected to other scenarios.
pca_raster(variables, in_format = NULL, scale = TRUE, center = TRUE,
n_pcs = NULL, project = FALSE, projection_variables,
return_projection = FALSE, write_to_directory = FALSE,
out_format = "GTiff", output_directory, overwrite = FALSE)
variables |
SpatRaster or character. If SpatRaster, stack of layers to be used; if character, name of the folder where environmental variables are. |
in_format |
(character) if class of |
scale |
(logical) whether or not to scale variables while performing principal component analyses. |
center |
(logical) whether or not to center variables while performing principal component analyses. |
n_pcs |
(numeric) number of principal components to be returned as raster layers. By default all principal components are returned. |
project |
(logical) whether or not to project the species niche to other
scenario(s). If TRUE, argument |
projection_variables |
character or SpatRaster. If character, name of
the folder where one or more sub-directories containing variables of distinct
environmental scenarios are (useful if multiple projections are needed).
If SpatRaster, stack of variables representing one scenario for projection.
Variable names must correspond with those of |
return_projection |
(logical) whether to return raster PCs for projection scenario(s) as part of the resulting list. Default = FALSE. |
write_to_directory |
(logical) whether to write results in
|
out_format |
(character) format of layers to be written in
|
output_directory |
(character) name of the folder to be created to save results. |
overwrite |
(logical) whether or not to overwrite the
|
A list containing:
PCA results
SpatRaster of principal components for variables
if return_projection = TRUE, list of SpatRaster objects with principal
components for other scenarios. NULL if project
= FALSE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.