ersst: NOAA Extended Reconstructed Sea Surface Temperature (ERSST)...

View source: R/ersst.R

ersstR Documentation

NOAA Extended Reconstructed Sea Surface Temperature (ERSST) data

Description

NOAA Extended Reconstructed Sea Surface Temperature (ERSST) data

Usage

ersst(year, month, overwrite = TRUE, version = "v5", ...)

Arguments

year

(numeric) A year. Must be > 1853. The max value is whatever the current year is. Required

month

A month, character or numeric. If single digit (e.g. 8), we add a zero in front (e.g., 08). Required

overwrite

(logical) To overwrite the path to store files in or not, Default: TRUE

version

(character) ERSST version. one of "v5" (default) or "v4"

...

Curl options passed on to crul::verb-GET

Details

See ersst_cache for managing cached files

ersst() currently defaults to use ERSST v5 - you can set v4 or v5 using the version parameter

If a request is unsuccesful, the file written to disk is deleted before the function exits.

If you use this data in your research please cite rnoaa (citation("rnoaa")), and cite NOAA ERSST (see citations at link above)

Value

An ncdf4 object. See ncdf4 for parsing the output

References

https://www.ncdc.noaa.gov/data-access/marineocean-data/extended-reconstructed-sea-surface-temperature-ersst-v5

Examples

## Not run: 
# October, 2015
ersst(year = 2015, month = 10)

# May, 2015
ersst(year = 2015, month = 5)
ersst(year = 2015, month = "05")

# February, 1890
ersst(year = 1890, month = 2)

# Process data
library("ncdf4")
res <- ersst(year = 1890, month = 2)
## varibles
names(res$var)
## get a variable
ncdf4::ncvar_get(res, "ssta")

## End(Not run)

rnoaa documentation built on April 27, 2023, 9:08 a.m.