Learn R Programming

climdex.pcic (version 0.1-3)

climdexInput.raw: climdexInput.raw

Description

These functions create climdexInput objects for use with the climdex methods.

Usage

climdexInput.raw(tmax, tmin, prec, tmax.dates, tmin.dates, prec.dates,
  base.range=c(1961, 1990), n=5)

climdexInput.csv(tmax.file, tmin.file, prec.file, data.columns=list(tmin="tmin", tmax="tmax", prec="prec"), base.range=c(1961, 1990), na.strings=NULL, cal="gregorian", date.types=NULL)

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.
tmax.file
Name of file containing daily maximum temperature data.
tmin.file
Name of file containing daily minimum temperature data.
prec.file
Name of file containing daily total precipitation data.
data.columns
Column names for tmin, tmax, and prec data.
date.types
Column names for tmin, tmax, and prec data (see notes).
na.strings
Strings used for NA values; passed to read.csv.
cal
The calendar type used in the input files.
base.range
Years to use for the baseline.
n
Number of days to use as window for daily quantiles.

Value

Details

These functions take input climate data, and produce as output a data structure which can be used with the other methods in this package to compute all of the Climdex indices as specified on the webpage cited in the references section.

climdexInput.csv should be used when your data is already in a CSV file. climdexInput.raw should be used in all other circumstances, as it is much more flexible. climdexInput.csv takes as arguments three input filenames, one for each of daily maximum temperature, minimum temperature, and total preciptation. Optionally, it also takes a list containing the names of the data columns for each of the variables stored in those files, a vector of NA strings for missing value handling, the baseline range, the window size, the calendar type, and a data structure containing the information needed to parse the dates out of the file.

climdexInput.raw takes as arguments the input daily maximum temperature, minimum temperature, and total precipitation data along with the associated series of dates and optionally the baseline range and window size.

References

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

See Also

climdex.pcic-package, strptime.

Examples

Run this code
## Create a climdexInput object from some data already loaded in and
## ready to go.
## tmax.data, tmin.data, and prec.data are vectors of real numbers.
ci <- climdexInput.raw(tmax.data, tmin.data, prec.data,
tmax.dates, tmin.dates, prec.dates, base.range=c(1971, 2000))

## Create a climdexInput object from a set of filenames (already stored
## as variables), with a different date format.
ci.csv <- climdexInput.csv(tmax.filename, tmin.filename,
prec.filename, date.types=list(list(fields=c("date"), format="%Y-%m-%d")))

Run the code above in your browser using DataLab