index.spell.mean: Spell length mean

View source: R/index.spell.mean.R

index.spell.meanR Documentation

Spell length mean

Description

Computes the mean duration of spells (above/below) a given threshold.

Usage

index.spell.mean(ts, dates, threshold = 1, threshold.type = "abs",
  condition = c("GT", "GE", "LT", "LE"))

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 absolute 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

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)

N. Neykov, S. Herrera, J. Bedia


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