Produce a correlation matrix of covariates

prep_correlation(covariates, logger = NULL)

Arguments

covariates

SpatRaster. Multi-layered SpatRaster

logger

Stores all notification messages to be displayed in the Log Window. Insert the logger reactive list here for running in shiny, otherwise leave the default NULL

Value

a matrix containing correlation coefficients

Author

Simon Smart simon.smart@cantab.net

Examples

covariate_files <- list.files(system.file("extdata", "covariates",
                              package = "disagapp"), full.names = TRUE)
covariate_list <- lapply(covariate_files, terra::rast)
covariates <- terra::rast(covariate_list)
correlation_matrix <- prep_correlation(covariates = covariates)