lds: Function to compute the average/maximum length of dry (as...

View source: R/indicesFAO_tier1.R

ldsR Documentation

Function to compute the average/maximum length of dry (as defined by wet.threshold) spells

Description

Function to compute the average/maximum length of dry (as defined by wet.threshold) spells

Usage

lds(
  pr,
  dates,
  length.spell = "mean",
  wet.threshold = 1,
  year = NULL,
  year.start = NULL,
  year.end = NULL,
  pnan = 25,
  lat = NULL
)

Arguments

pr

Vector with daily precipitation

dates

Matrix containing the full range of dates corresponding to "pr" (ndates x 3 size); e.g. rbind(c(1995, 3, 1), c(1995, 3, 2), ...)

length.spell

Either "mean" or "maximum" length spell

wet.threshold

Threshold considered to define wet days. Must be in the same units of "pr"

year

Vector with years of interest (e.g. 1990:1995)

year.start

Vector of dates [in "YYYY-MM-DD" format] defining the beginning of a portion of interest within each year (e.g., the agronomic season)

year.end

Vector of dates [in "YYYY-MM-DD" format] defining the end of a portion of interest within each year (e.g., the agronomic season)

pnan

Any year with a percentage of NA data above "pnan" will be ignored

lat

Latitude (NULL) to indicate that latitude information is not used.

Value

Average/maximum length of dry spells (per year)

Author(s)

R. Manzanas


SantanderMetGroup/climate4R.indices documentation built on July 3, 2023, 11:02 p.m.