generateEnvirem {envirem} | R Documentation |
Generate ENVIREM rasters
Description
Generates rasters from an input dataset.
Usage
generateEnvirem(
masterstack,
solradstack = NULL,
monthPET = NULL,
var,
tempScale = 1,
precipScale = 1
)
Arguments
masterstack |
rasterStack containing all monthly precipitation, min temperature, max temperature, and optionally mean temperature rasters. |
solradstack |
rasterStack of monthly solar radiation, can be |
monthPET |
rasterStack of monthly potential evapotranspiration. If |
var |
vector of names of variables to generate, see Details. |
tempScale |
integer; scaling factor for the temperature data, see envirem for additional details. |
precipScale |
integer; scaling factor for the precipitation data, see envirem for additional details. |
Details
The function verifyRasterNames
should be used to
verify that the appropriate rasters are present in masterstack
.
Possible variables to generate include:
annualPET
aridityIndexThornthwaite
climaticMoistureIndex
continentality
embergerQ
growingDegDays0
growingDegDays5
maxTempColdest
minTempWarmest
meanTempColdest
meanTempWarmest
monthCountByTemp10
PETColdestQuarter
PETDriestQuarter
PETseasonality
PETWarmestQuarter
PETWettestQuarter
thermicityIndex
If var = 'all'
, then all of the variables will be generated.
Value
rasterStack
Author(s)
Pascal Title
Examples
# Find example rasters
rasterFiles <- list.files(system.file('extdata', package='envirem'), full.names=TRUE)
# create stack of temperature and precipitation rasters
# and stack of solar radiation rasters
solradFiles <- grep('solrad', rasterFiles, value=TRUE)
worldclim <- rast(setdiff(rasterFiles, solradFiles))
solar <- rast(solradFiles)
# set up naming scheme - only precip is different from default
assignNames(precip = 'prec_##')
# generate all possible envirem variables
generateEnvirem(worldclim, solar, var='all', tempScale = 10)
# set back to defaults
assignNames(reset = TRUE)