Calculate the Pearson correlation coefficient matrix for a rasterstack

## Usage

pearson_correlation_matrix(x, cachesize = 20, same_mask = FALSE)

## Arguments

x

RasterStack. The stack of rasters you want to calculate the Pearson correlation coefficient matrix for. This can be obtained by calling load_layers.

cachesize

integer. For how many rasters should the values be kept in local memory. By default this is set to 20, a parameter which works reasonably well on a windows computer with 8GB RAM.

logical. Whether we can assume that the mask is the same for all layers (same NA values), default is FALSE.

## Value

A correlation matrix.

layers_correlation plot_correlation load_layers

## Examples

if (FALSE) {
# calculate correlation between SST and salinity in the Baltic Sea

# warning using tempdir() implies that data will be downloaded again in the
# next R session