if (grassStarted()) {
# Setup
library(terra)
# Example data
madChelsa <- fastData("madChelsa")
# Convert a SpatRaster to a GRaster:
chelsa <- fast(madChelsa)
# Correlation
layerCor(chelsa, "cor")
# Covariance
layerCor(chelsa, "cov")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.