Learn R Programming

climdex.pcic (version 1.1-11)

total.precip.op.threshold: Sum of precipitation above a threshold

Description

This function returns the sum of values above a threshold for each period (as defined by date.factor).

Usage

total.precip.op.threshold(daily.prec, date.factor, threshold, op)

Arguments

daily.prec

Data to compute index on.

date.factor

Date factor to split by.

threshold

The threshold to compare to.

op

The operator to use to compare data to threshold.

Value

A timeseries of sums of numbers above the threshold for each period.

Details

This routine sums up all values which exceed or are below (depending on op) the given threshold.

See Also

climdex.r99ptot.

Examples

Run this code
# NOT RUN {
prec.dat <- c(0.1, 3.0, 4.3, 1.9, 1.3, 6.0, 0, 0, 4.0, 1)
phony.date.factor <- factor(rep(1:2, each=5))

## Compute equiv of PRCPTOT
prec.sum <- total.precip.op.threshold(prec.dat, phony.date.factor, 1, ">=")
# }

Run the code above in your browser using DataLab