gseason_prec: gseason_prec: Calculates the growing season period as...

Description Usage Arguments Details Value See Also Examples

Description

gseason_prec calculates growing season period where precipitation exceeds half the potential evapotranspiration.

Usage

1
gseason_prec(prec, evap, tme, period = "monthly", surplus = TRUE)

Arguments

prec

a vector of precipitation values.

evap

a vector of evapotranspiration values.

tme

a POSIXlt object representing the date and time of each evap value.

period

an optional character string defining time period of precipitation and evapotranspiration measurements. Options include "monthly" and "bimonthly". If left unspecified, assumed 'submonthly'.

surplus

default = TRUE

Details

The growing season is defined as the period when precipitation exceeds half the potential evapotranspiration. If period is "monthly", data are aggregated by each month. If period is "bimonthly", data are aggregated by each half-month. If surplus = 'TRUE', generates a vector of growing season values for the specified time period. Requires wrapper functions submonthly and cumsumseq to be loaded.

Value

A vector of binary values, where 1 indicates growing season and 0 indicates not growing season.

See Also

the tmecreate() function can be used to create a POSIXlt object.

submonthly()

cumsumseq()

Examples

1
2
3
4
5
6
prec <- (10 * sin(c(0:364) * (pi / -360)) + rnorm(365) + 15)
evap <- (10 * sin(c(0:364) * (pi / +360)) + rnorm(365) + 2)
tme <- tmecreate(2010, 24)
gsp <- gseason_prec(prec, evap, tme, period = "monthly", surplus = TRUE)
gsp <- gseason_prec(prec, evap, tme, period = "bimonthly", surplus = TRUE)
plot(gsp)

ilyamaclean/climvars documentation built on June 19, 2019, 2:22 p.m.