This 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.
import_ghcn_stations(
name = NULL,
country = NULL,
state = NULL,
lat = NULL,
lng = NULL,
crs = 4326,
n_max = 10L,
database = c("hourly", "daily"),
return = c("table", "sf", "map")
)One of:
String values to use to filter the metadata for
specific site names, countries and states. country and state are
matched exactly to codes accessed using import_ghcn_countries(). name
is searched as a sub-string case insensitively.
Decimal latitude (lat) and longitude (lng) (or other
Y/X coordinate if using a different crs). If provided, the n_max
closest ISD stations to this coordinate will be returned.
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 using crs (e.g., crs = 27700 for the British National Grid). Note that
non-lat/lng coordinate systems will be re-projected to EPSG:4326 for
making comparisons with the NOAA metadata.
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.
The type of R object to import the GHCN stations as. One of the following:
"table", which returns an R data.frame.
"sf", which returns a spatial data.frame from the sf package.
"map", which returns an interactive leaflet map.
Jack Davison
Other GHCN functions:
import_ghcn_countries(),
import_ghcn_daily(),
import_ghcn_hourly(),
import_ghcn_inventory(),
import_ghcn_monthly_temp()