bio13: bio13: Calculates precipitation of the wettest period

Description Usage Arguments Details Value See Also Examples

Description

bio13 is used to calculate the precipitation of the wettest week or month of the year, depending on the time step.

Usage

1
bio13(prec, tme, method = "week")

Arguments

prec

a vector of precipitation values, normally for one year (see details).

tme

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

method

An optional character string describing how the maximum weekly or monthly precipitation is calculated. Options are "week" and "month" (see details).

Details

If method is "week", monthly precipitation values are spline interpolated to a weekly time period and the maximum weekly precipitation is returned. If method is "month", monthly precipitation values are summed and the maximum monthly precipitation is returned.

If data span more than one year, data are aggregated by unique month irrespective of year and one value returned.

Value

a single numeric value of total precipitation in the wettest week or month of the year.

See Also

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

Examples

1
2
3
4
5
6
prec <- (10 * sin(c(0:364) * (pi / -360)) + rnorm(365) + 12)
tme <- tmecreate(2010, 24)
plot(prec~as.POSIXct(tme), type = "l", xlab = "Month", ylab = "Precipitation")
bio13(prec, tme, method="week")
bio13(prec, tme, method="month")
bio13(prec, tme)

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