bio12: bio12: Calculates total annual precipitation

Description Usage Arguments Details Value See Also Examples

Description

bio12 is used to calculate total precipitation in the year

Usage

1
bio12(prec, tme, method = "")

Arguments

prec

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

tme

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

method

An optional character string describing the method used to calculate total annual precipitation. Options are "anuclim" or unspecified (see details).

Details

If method is "anuclim", monthly precipitation values are spline interpolated to a weekly time period and the total for each year returned. Otherwise, all precipitation values for each year are summed.

Value

a single numeric value of total annual precipitation.

See Also

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

Examples

1
2
3
4
5
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")
bio12(prec, tme)
bio12(prec, tme, method="anuclim")

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