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.
- Look for weather stations & get station id(s)
- Find out what type of data is available for those stations
- Search for climate data for stations (optionally specify type of data to get)
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
Here, we are specifying the
ncdc(datasetid = "GHCND", stationid = id, datatypeid = "PRCP", startdate = "2012-10-01", enddate = "2013-01-01")