Learn R Programming

oce (version 0.9-18)

read.index: Read a NOAA ocean index file

Description

Read an ocean index file, in the format used by NOAA.

Usage

read.index(file, tz=getOption("oceTz"), debug=getOption("oceDebug"))

Arguments

file
a connection or a character string giving the name of the file to load. May be a URL.
tz
character string indicating time zone to be assumed in the data.
debug
a flag that turns on debugging, ignored in the present version of the function.

Value

  • A data frame containing t, a POSIX time, and index, the numerical index. The times are set to the 15th day of each month, which is a guess that may need to be changed if so indicated by documentation (yet to be located).

Details

Reads a text-format index file, in a format used by NOAA. The first line holds two numbers, for start year and end year. Then there are several lines containing 13 numbers, the first being the year, and the others being the data. Then there is a line with a single number, the missing value. Then there are some headers lines (which are ignored in the present version of read.index.

References

See http://www.esrl.noaa.gov/psd/data/climateindices/list/ for a list of indices.

Examples

Run this code
library(oce)
# Arctic oscillation
ao <- read.index("http://www.esrl.noaa.gov/psd/data/correlation/ao.data")
recent <- subset(ao, t > as.POSIXct("2000-01-01"))
oce.plot.ts(recent$t, recent$index)

Run the code above in your browser using DataLab