
Import station metadata for the Global Historical Climatology Network
Source:R/import_ghcn_stations.R
import_ghcn_stations.RdThis function accesses a full list of GHCN stations available through either
the GHCNh or GHCNd. As well as the station id, needed for importing
measurement data, useful geographic and network metadata is also returned.
Arguments
- name, country, state
String values to use to filter the metadata for specific site names, countries and states.
countryandstateare matched exactly to codes accessed usingimport_ghcn_countries().nameis searched as a sub-string case insensitively.- lat, lng, n_max
Decimal latitude (
lat) and longitude (lng) (or other Y/X coordinate if using a differentcrs). If provided, then_maxclosest ISD stations to this coordinate will be returned.- crs
The coordinate reference system (CRS) of the data, passed to
sf::st_crs(). By default this is EPSG:4326, the CRS associated with the commonly used latitude and longitude coordinates. Different coordinate systems can be specified usingcrs(e.g.,crs = 27700for the British National Grid). Note that non-lat/lng coordinate systems will be re-projected toEPSG:4326for making comparisons with the NOAA metadata.- database
One of
"hourly"or"daily", which defines whether to import stations available in the GHCNh or GHCNd. Note that there is overlap between the two, but some stations may only be available in one or the other.- return
The type of R object to import the GHCN stations as. One of the following:
"table", which returns an Rdata.frame."sf", which returns a spatialdata.framefrom thesfpackage."map", which returns an interactiveleafletmap.
See also
Other GHCN functions:
import_ghcn_countries(),
import_ghcn_daily(),
import_ghcn_hourly(),
import_ghcn_inventory(),
import_ghcn_monthly_temp()