add_indices: Add drought indices to a data.frame of climate variables

Description Usage Arguments Value

View source: R/add_indices.R

Description

Currently add DMI, and SPEI and SPI for different scales. PET for SPEI is computed according to Hargreaves.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
add_indices(
  x,
  scales = c(1, 2, 3, 6, 12),
  id = "id",
  lat = "lat",
  tmean = "tmean",
  tmin = "tmin",
  tmax = "tmax",
  prec = "prec",
  drop_lat = TRUE
)

Arguments

x

a data.frame with climate data, that has at least id for location id, lat for latitude, year, month, tmean, tmin, and tmax for mean, minimum, and maximum temperature, and prec for precipitation.

scales

for which temporal scales should spei and spi be computed

id

character string for location id variable

lat

character string for lat variable

tmean

character string for tmean variable

tmin

character string for tmin variable

tmax

character string for tmax variable

prec

character string for prec variable

drop_lat

should latitude be dropped from result?

Value

a data.frame consisting of the original climate data with additional variables for drought indices


cszang/clex documentation built on Sept. 27, 2020, 2:42 p.m.