Learn R Programming

envirem (version 2.3)

climaticMoistureIndex: Climatic Moisture Index

Description

Generate climatic moisture index.

Usage

climaticMoistureIndex(annualPrecip, PET, precipScale = 1)

Value

rasterLayer ranging from -1 to +1.

Arguments

annualPrecip

rasterLayer of annual precipitation (bioclim 12)

PET

rasterLayer of annual potential evapotranspiration

precipScale

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

Author

Pascal Title

Details

P/PET - 1 when P < PET
1 - PET/P when P >= PET

References

Willmott, C. & Feddema, J. (1992). A More Rational Climatic Moisture Index. The Professional Geographer, 44, 84-88.

Vörösmarty, C.J., Douglas, E.M., Green, P.A. & Revenga, C. (2005). Geospatial Indicators of Emerging Water Stress: An Application to Africa. AMBIO: A Journal of the Human Environment, 34, 230-236.

Examples

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

# identify the appropriate layers
meantemp <- grep('mean', names(env), value=TRUE)
solar <- grep('solrad', names(env), value=TRUE)
maxtemp <- grep('tmax', names(env), value=TRUE)
mintemp <- grep('tmin', names(env), value=TRUE)

# read them in as rasterStacks
meantemp <- stack(env[[meantemp]])
solar <- stack(env[[solar]])
maxtemp <- stack(env[[maxtemp]])
mintemp <- stack(env[[mintemp]])
tempRange <- abs(maxtemp - mintemp)

# get monthly PET
pet <- monthlyPET(meantemp, solar, tempRange)

# get mean annual PET
annualPET <- sum(pet)

climaticMoistureIndex(env[['bio_12']], annualPET)
# }

Run the code above in your browser using DataLab