man/examples/ex_layerCor.r

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")

}

Try the fasterRaster package in your browser

Any scripts or data that you put into this service are public.

fasterRaster documentation built on June 8, 2025, 12:17 p.m.