pcs | R Documentation |
Retrieve a principal components model from a PCA GRaster
pcs(x)
x |
A |
An object of class prcomp
.
princomp()
, terra::princomp()
, module i.pca
in GRASS
if (grassStarted()) {
# Setup
library(terra)
# Climate raster:
madChelsa <- fastData("madChelsa")
# Convert a SpatRaster to a GRaster:
chelsa <- fast(madChelsa)
# Generate raster with layers representing principal component predictions:
pcRast <- princomp(chelsa, scale = TRUE)
plot(pcRast)
# Get information on the PCA:
prinComp <- pcs(pcRast)
prinComp
summary(prinComp)
plot(prinComp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.