Learn R Programming

rnoaa (version 0.6.0)

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

Description

NOAA Extended Reconstructed Sea Surface Temperature (ERSST) data

Usage

ersst(year, month, path = "~/.rnoaa/ersst", overwrite = TRUE, ...)

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
path
(character) A path to store the files, a directory. Default: ~/.rnoaa/ersst. Required.
overwrite
(logical) To overwrite the path to store files in or not, Default: TRUE
...
Curl options passed on to GET. Optional

Value

An ncdf4 object for now, may change output later to perhaps a data.frame. See ncdf4 for parsing the output.

Details

NetCDF files are downloaded, stored, and read from the directory given in the path parameter. The default is ~/.rnoaa/ersst, and files are saved within whatever that directory is.

Files are quite small, so we don't worry about reading in cached data to save time, as we do in other functions in this package.

References

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

Examples

Run this code
## 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, "lon_bnds")
# 
# # curl debugging
# library('httr')
# ersst(year = 2015, month = 10, config=verbose())
# ## End(Not run)

Run the code above in your browser using DataLab