Learn R Programming

envirem (version 3.0)

monthCountByTemp: Month count by temperature

Description

Number of months with mean temperature greater than some base temp.

Usage

monthCountByTemp(tempStack, minTemp = 10, tempScale = 1)

Value

rasterLayer with values representing counts of months.

Arguments

tempStack

SpatRaster of monthly mean temperature in degrees C

minTemp

reference temperature in degrees C

tempScale

integer; scaling factor for the temperature data, see envirem for additional details.

Author

Pascal Title

References

Metzger, M.J., Bunce, R.G.H., Jongman, R.H.G., Sayre, R., Trabucco, A. & Zomer, R. (2013). A high-resolution bioclimate map of the world: a unifying framework for global biodiversity research and monitoring. Global Ecology and Biogeography, 22, 630-638.

Examples

Run this code
# Find example rasters
rasterFiles <- list.files(system.file('extdata', package='envirem'), full.names=TRUE)
env <- rast(rasterFiles)

# identify the appropriate layers
meantemp <- grep('mean', names(env), value=TRUE)
meantemp <- env[[meantemp]]
monthCountByTemp(meantemp, 10, tempScale = 10)

Run the code above in your browser using DataLab