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

View source: R/indices.R

total.precip.op.thresholdR Documentation

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).

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

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.

See Also

climdex.r99ptot.

Examples


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, ">=")


ECA-D/climind documentation built on Nov. 26, 2022, 10:20 a.m.