Description Usage Arguments Details Value Authentication References See Also Examples
View source: R/ncdc_datacats.r
Data Categories represent groupings of data types.
1 2 3 |
datasetid |
Accepts a valid dataset id or a vector or list of dataset id's. Data returned will be from the dataset specified, see datasets() (required) |
datacategoryid |
A valid data category id. Data types returned will be associated with the data category(ies) specified |
stationid |
Accepts a valid station id or a vector or list of station ids (optional) |
locationid |
Accepts a valid location id or a vector or list of location id's. (optional) |
startdate |
Accepts valid ISO formated date (yyyy-mm-dd). Data returned will have data after the specified date. Paramater can be use independently of enddate (optional) |
enddate |
Accepts valid ISO formated date (yyyy-mm-dd). Data returned will have data before the specified date. Paramater can be use independently of startdate (optional) |
sortfield |
The field to sort results by. Supports id, name, mindate, maxdate, and datacoverage fields (optional) |
sortorder |
Which order to sort by, asc or desc. Defaults to asc (optional) |
limit |
Defaults to 25, limits the number of results in the response. Maximum is 1000 (optional) |
offset |
Defaults to 0, used to offset the resultlist (optional) |
token |
This must be a valid token token supplied to you by NCDC's Climate Data Online access token generator. (required) See Authentication section below for more details. |
... |
Further named parameters, such as |
Note that calls with both startdate and enddate don't seem to work, though specifying one or the other mostly works.
A data.frame
for all datasets, or a list of length two, each
with a data.frame.
Get an API key (aka, token) at http://www.ncdc.noaa.gov/cdo-web/token. You can pass your token in as an argument or store it one of two places:
your .Rprofile file with an entry like
options(noaakey = "your-noaa-token")
your .Renviron file with an entry like
NOAA_KEY=your-noaa-token
See Startup
for information on how to create/find your
.Rrofile and .Renviron files
Vignette at http://ropensci.org/tutorials/rnoaa_tutorial.html
https://www.ncdc.noaa.gov/cdo-web/webservices/v2
Other ncdc: ncdc_combine
,
ncdc_datasets
,
ncdc_datatypes
,
ncdc_locs_cats
, ncdc_locs
,
ncdc_plot
, ncdc_stations
,
ncdc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
## Limit to 10 results
ncdc_datacats(limit=10)
## by datasetid
ncdc_datacats(datasetid="ANNUAL")
ncdc_datacats(datasetid=c("ANNUAL", "PRECIP_HLY"))
## Single data category
ncdc_datacats(datacategoryid="ANNAGR")
## Fetch data categories for a given set of locations
ncdc_datacats(locationid='CITY:US390029')
ncdc_datacats(locationid=c('CITY:US390029', 'FIPS:37'))
## Data categories for a given date
ncdc_datacats(startdate = '2013-10-01')
# Get data categories with data for a series of the same parameter arg, in this case
# stationid's
ncdc_datacats(stationid='COOP:310090')
ncdc_datacats(stationid=c('COOP:310090','COOP:310184','COOP:310212'))
## Curl debugging
ncdc_datacats(limit=10, config=verbose())
out <- ncdc_datacats(limit=10, config=progress())
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.