Learn R Programming

envirem (version 3.0)

otherTempExtremes: Temperature Extremes

Description

Generates max temp of the coldest month, min temp of the warmest month, mean temp of the coldest month, mean temp of the warmest month.

Usage

otherTempExtremes(meantempStack, mintempStack, maxtempStack)

Value

SpatRaster of maxTempColdest, minTempWarmest, meanTempColdest, meanTempWarmest, in same units as input rasters.

Arguments

meantempStack

SpatRaster of monthly mean temperature

mintempStack

SpatRaster of monthly min temperature

maxtempStack

SpatRaster of monthly max temperature

Author

Pascal Title

Examples

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

# identify appropriate layers
tmean <- grep('tmean', names(env))
tmin <- grep('tmin', names(env))
tmax <- grep('tmax', names(env))

tmean <- env[[tmean]]
tmin <- env[[tmin]]
tmax <- env[[tmax]]

# calculate temperature extremes
otherTempExtremes(tmean, tmin, tmax)
# }

Run the code above in your browser using DataLab