read.noaa: Read data from NOAA's Climate Data Online Web Services

View source: R/weatherHelper.R

read.noaaR Documentation

Read data from NOAA's Climate Data Online Web Services

Description

Queries NOAA's Web Services according to the following documentation: http://www.ncdc.noaa.gov/cdo-web/webservices/v2.

Usage

read.noaa(table, param = NULL, quietly = TRUE)

Arguments

table

the data table to query from, examples include "locations", "stations", "data"

param

extra parameters for the search

Details

To use this function you need to get a key for NOAA's API. This is free and you can generate one here: https://www.ncdc.noaa.gov/cdo-web/token. All weather functions in rterm look for an object in the global environment called "noaa_key". You can deal with this by taking the following line:

noaa_key <- "your_key_here"

and placing it either before the library(rterm) statement, or, preferably, in a .Rprofile that gets run when you load R. http://www.statmethods.net/interface/customizing.html

By default the queries return only 25 entries with a maximum limit of 1000, so be mindful that often much of what you thought you were querying is not returned.

See Also

read.ghcn

Examples

# Show available datasets
read.noaa("datasets")

# Show available data types of category "TEMP"
read.noaa("datatypes", "datacategoryid=TEMP&limit=100")

# Show locations for the location category of US State
read.noaa("locations", "locationcategoryid=ST&limit=51")

# Show Stations in Washington State recording Temperature GHCN
# daily datasets since 2010
tmp <- read.noaa("stations", paste("locationid=FIPS:53",
                                    "datacategoryid=TEMP",
                                    "datasetid=GHCND",
                                    "startdate=2010-01-01",
                                    "limit=1000", sep = "&"))

EcotopeResearch/rterm documentation built on Oct. 17, 2022, 4:02 p.m.