Learn R Programming

rnoaa (version 0.4.0)

ncdc_legacy: Search the NOAA NCDC legacy API - main purpose to get ISD daily data.

Description

Search the NOAA NCDC legacy API - main purpose to get ISD daily data.

Usage

ncdc_leg_variables(dataset = "isd", variable = NULL, token = NULL, ...)

ncdc_leg_sites(dataset = "isd", state_id = NULL, state_abbrev = NULL, country_id = NULL, country_abbrev = NULL, token = NULL, ...)

ncdc_leg_site_info(dataset = "isd", station, token = NULL, ...)

ncdc_leg_data(dataset = "isd", station, variable, start_date, end_date, token = NULL, ...)

Arguments

dataset
Dataset id, one of isd (default), ish, or daily.
variable
A variable id.
token
Your token. Store as environment variable as NOAA_LEG_TOKEN or option variable as noaalegtoken.
...
Further args passed to GET
state_id
State ID
state_abbrev
State abbreviation
country_id
Country id
country_abbrev
Country abbreviation
station
A station id.
start_date,end_date
Date to start and end search for. Valid formats include, YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, and YYYYMMDDhhmm.

Details

BEWARE: This service, as far as I can tell, enforces a wait time between successive data requests of 60 seconds. This is indeed a long time.

References

http://www7.ncdc.noaa.gov/wsregistration/ws_home.html, http://www7.ncdc.noaa.gov/rest/, http://www7.ncdc.noaa.gov/wsregistration/CDOServices.html

Examples

Run this code
## Not run: ------------------------------------
# # Variables
# ## All variables
# ncdc_leg_variables()
# ## Specific variables
# ### Air Temperature Observation
# ncdc_leg_variables(variable = "TMP")
# ### Snow Accumulation For The Month
# ncdc_leg_variables(variable = "AN1")
# 
# # Sites
# head( ncdc_leg_sites() )
# ncdc_leg_sites(country_id = 1)
# ncdc_leg_sites(country_abbrev = 'CA')
# ncdc_leg_sites(state_id = 11)
# ncdc_leg_sites(state_abbrev = 'HI')
# ## site info
# ncdc_leg_site_info(station=71238099999)
# 
# # Data
# ncdc_leg_data('isd', 71238099999, 'TMP', 200101010000, 200101312359)
# ncdc_leg_data('isd', 71238099999, 'TMP', 200101, 200201)
## ---------------------------------------------

Run the code above in your browser using DataLab