View source: R/make_gsod_set.R
make_GSOD_set | R Documentation |
This function can be wrapped in an base::lapply()
function to
retrieve and save multiple years of GSOD data for interpolation,
though it may be used to retrieve GSOD data and interpolate files on-the-fly.
See utils::vignette("glint")
for more details and examples.
make_GSOD_set(years, dsn = NULL)
years |
A numeric vector of years of GSOD data to get for interpolation. Defaults to current year. |
dsn |
Optional. A file path where resulting fst files are to be saved on local disk. If unspecified a tidy data frame is returned in the R session. |
This function will get GSOD data using
GSODR::get_GSOD()
and save a CSV file containing only the
following fields to use in interpolating a global surface between 60 and -60
degrees latitude.
A unique station id number that can be used to identify the station and link with GSODR data for station metadata.
Longitude in decimal degrees.
Latitude in decimal degrees.
Elevation in metres.
The year (YYYY).
Sequential day of year.
Mean daily temperature in degrees C to tenths. Missing = NA.
Maximum temperature reported during the day in Celsius to tenths. Missing = NA;
Minimum temperature reported during the day in Celsius to tenths. Missing = NA;
Mean daily relative humidity. Missing = NA.
A base::list()
of base::data.frame
objects containing
GSOD data suitable for interpolation using interpolate_gsod()
and optionally data files written to disk in fst::fst()
format.
Adam H. Sparks, adamhsparks@gmail.com
# Get one year of GSOD data #gsod_1998 <- make_GSOD_set(years = 1998) # Get multiple years of GSOD data and save to disk #years <- as.list(seq(from = 1983, to = 2017, by = 1)) #lapply(X = years, FUN = make_GSOD_set, dsn = "~/Data/GSOD")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.