Learn R Programming

climdex.pcic (version 1.0-3)

get.outofbase.quantiles: Method for getting threshold quantiles for use in computing indices

Description

This function creates threshold quantiles for use with climdexInput.raw or climdexInput.csv.

Usage

get.outofbase.quantiles(tmax = NULL, tmin = NULL,
    prec = NULL, tmax.dates = NULL, tmin.dates = NULL,
    prec.dates = NULL, base.range = c(1961, 1990), n = 5,
    pad.data.with.first.last.values = FALSE,
    temp.qtiles = c(0.1, 0.9), prec.qtiles = c(0.95, 0.99),
    min.base.data.fraction.present = 0.1)

Arguments

tmax
Daily maximum temperature data.
tmin
Daily minimum temperature data.
prec
Daily total precipitation data.
tmax.dates
Dates for the daily maximum temperature data.
tmin.dates
Dates for the daily minimum temperature data.
prec.dates
Dates for the daily total precipitation data.
base.range
Years to use for the baseline.
n
Number of days to use as window for daily quantiles.
pad.data.with.first.last.values
Base data padding option (see notes).
temp.qtiles
Quantiles to calculate for temperature variables
prec.qtiles
Quantiles to calculate for precipitation
min.base.data.fraction.present
Minimum fraction of base data that must be present for quantile to be calculated for a particular day
quantiles
Threshold quantiles for supplied variables.

Value

  • A set of threshold quantiles

Details

This function takes input climate data at daily resolution, and produces as output a set of threshold quantiles. This data structure can then be passed to climdexInput.raw or climdexInput.csv.

For more details on arguments, see link{climdexInput.raw}.

References

http://cccma.seos.uvic.ca/ETCCDMI/list_27_indices.shtml

See Also

climdex.pcic-package, climdexInput.raw.

Examples

Run this code
## Create a climdexInput object from some data already loaded in and
## ready to go.

## Parse the dates into PCICt.
tmax.dates <- as.PCICt(do.call(paste, ec.1018935.tmax[,c("year",
"jday")]), format="%Y %j", cal="gregorian")
tmin.dates <- as.PCICt(do.call(paste, ec.1018935.tmin[,c("year",
"jday")]), format="%Y %j", cal="gregorian")
prec.dates <- as.PCICt(do.call(paste, ec.1018935.prec[,c("year",
"jday")]), format="%Y %j", cal="gregorian")

## Load the data in.
quantiles <- get.outofbase.quantiles(ec.1018935.tmax$MAX_TEMP,
ec.1018935.tmin$MIN_TEMP, ec.1018935.prec$ONE_DAY_PRECIPITATION,
tmax.dates, tmin.dates, prec.dates, base.range=c(1971, 2000))

Run the code above in your browser using DataLab