knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE, cache = TRUE )
This vignette is intended to demonstrate a workflow for using the NOAA NCDC data using the ncdc*()
functions. It can be confusing to understand how to get at data you want - that's the motivation for this vignette. Other vignettes show more thorough and different examples for specific data sources.
library('rnoaa')
ids <- ncdc_stations(locationid='FIPS:12017')$data$id[1:13] id <- "GHCND:US1FLCT0002"
Just information for one station
ncdc_stations(stationid = id)
There are various ways to look for data types available. First, data categories:
ncdc_datacats(stationid = id)
Another way is looking for data sets:
ncdc_datasets(stationid = id)
Yet another way is looking for data types:
ncdc_datatypes(datasetid = "GHCND", stationid = id)
Now that you know what kinds of data categories, data sets, and data types are available for your station you can search for data with any of those as filters.
Importantly, note that you have to specify three things in a call to the ncdc
function:
datasetid
startdate
enddate
Here, we are specifying the datasetid
, stationid
, datatypeid
, startdate
, and enddate
ncdc(datasetid = "GHCND", stationid = id, datatypeid = "PRCP", startdate = "2012-10-01", enddate = "2013-01-01")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.