Learn R Programming

FedData (version 2.0.2)

get_ghcn_daily: Download and crop the Global Historical Climate Network-Daily data.

Description

get_ghcn_daily returns a named list of length 2:
  1. "spatial": ASpatialPointsDataFrameof the locations of GHCN weather stations in the template, and
  2. "tabular": A named list ofdata.frameswith the daily weather data for each station. The name of each list item is the station ID.

Usage

get_ghcn_daily(template = NULL, label = NULL, elements = NULL,
  raw.dir = "./RAW/GHCN/", extraction.dir = "./EXTRACTIONS/GHCN/",
  standardize = F, force.redo = F)

Arguments

template
A Raster* or Spatial* object to serve as a template for cropping. Alternatively, a character vector providing GHCN station IDs. If missing, all stations will be downloaded!
label
A character string naming the study area.
elements
A character vector of elemets to extract. The five core elements are: PRCP = Precipitation (tenths of mm) SNOW = Snowfall (mm) SNWD = Snow depth (mm) TMAX = Maximum temperature (tenths of degrees C) TMIN = Minimum temperature (tenths of degrees C) The ot
raw.dir
A character string indicating where raw downloaded files should be put. The directory will be created if missing. Defaults to "./RAW/GHCN/".
extraction.dir
A character string indicating where the extracted and cropped GHCN shapefiles should be put. The directory will be created if missing. Defaults to "./EXTRACTIONS/GHCN/".
standardize
Select only common year/month/day? Defaults to FALSE.
force.redo
If an extraction for this template and label already exists, should a new one be created? Defaults to FALSE.

Value

  • A named list containing the "spatial" and "tabular" data.