R: Method for getting threshold quantiles for use in computing...

get.outofbase.quantiles {climdex.pcic} | R Documentation

## 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, 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.
`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.

### 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 `climdexInput.raw`.

### Value

A set of threshold quantiles

### Note

Units are assumed to be mm/day for precipitation and degrees Celsius for temperature. No units conversion is performed internally.

### References

http://etccdi.pacificclimate.org/list_27_indices.shtml

### See Also

`climdex.pcic-package`, `climdexInput.raw`.

### Examples

    library(PCICt)

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

[Package climdex.pcic version 1.1-11 Index]