index.spellmax.annual.prcXXth: Annual spell length percentiles

View source: R/index.spellmax.annual.prcXXth.R

index.spellmax.annual.prcXXthR Documentation

Annual spell length percentiles

Description

Computes a user-defined percentile for the duration of spells (above/below) a given threshold, on an annual basis.

Usage

index.spellmax.annual.prcXXth(ts, dates, threshold = 1,
  threshold.type = "abs", condition = c("GT", "GE", "LT", "LE"),
  prob = 0.5)

Arguments

ts

A vector containing the data

dates

A character (or POSIXct) vector following the format “YYYY-MM-DD” (i.e., format = "%Y-%m-%d" as in strptime). This is directly passed by the VALUE objects (either stations or predictions) through the element object$Dates$start.

threshold

A float number defining the threshold considered. Default to 1

threshold.type

Is the value of threshold an absolute value or a quantile [0-1]?. Two possible values: "abs" and "prob" respectively. Default to "abs".

condition

Inequality operator to be applied considering the given threshold. "GT" = greater than the value of threshold, "GE" = greater or equal, "LT" = lower than, "LE" = lower or equal than

prob

A float number in the range [0,1] defining the probability of the quantile to be calculated. Default to median (prob = 0.5).

Details

The function requires the date information in order to ensure that spells are computed on consecutive records.

Value

A float number with the corresponding percentile.

Author(s)

J. Bedia, J.M. Gutierrez


SantanderMetGroup/R_VALUE documentation built on July 4, 2023, 4:27 a.m.