calculate_statistics {sdmpredictors}R Documentation

Calculate statistics for a given raster.

Description

Method used to calculate the statistics of all layers. It can be re-used to calculate statistics for a cropped version of the rasters.

Usage

calculate_statistics(layercode, raster)

Arguments

layercode

character. Name of the layer.

raster

RasterLayer. The raster you want to calculate statistics for.

Value

A dataframe with the layercode and all basic statistics.

See Also

layer_stats

Examples

## Not run: 
# calculate statistics of the SST and salinity in the Baltic Sea

# warning using tempdir() implies that data will be downloaded again in the 
# next R session
x <- load_layers(c("BO_sstmax", "BO_salinity"), datadir = tempdir())
e <- extent(13, 31, 52, 66)
baltics <- crop(x, e)
View(rbind(calculate_statistics("SST Baltic Sea", raster(x, layer = 1)))
           calculate_statistics("Salinity Baltic Sea", raster(x, layer = 2)))

## End(Not run)

[Package sdmpredictors version 0.2.15 Index]