View source: R/dlGsodStations.R
dlGsodStations | R Documentation |
Download (and extract) data from a GSOD station based on its unique USAF code.
dlGsodStations(
usaf,
start_year = NA,
end_year = NA,
dsn = ".",
unzip = FALSE,
rm_gz = FALSE,
...
)
usaf |
Numeric. A unique USAF station code. It can either be manually
determined from built-in |
start_year |
Numeric. The desired year to start data acquisition. If not supplied, download starts from the first year of measurement. |
end_year |
Numeric. The desired year to stop data acquisition. If not supplied, download stops at the last year of measurement. |
dsn |
Character, default is the current working directory. Destination folder for data download. |
unzip |
Logical, default is FALSE. If TRUE, *.gz files are unpacked and merged after download. |
rm_gz |
Logical, default is FALSE. If TRUE, *.gz files are removed after
extraction. If |
... |
Additional arguments passed to |
A vector of *.gz filenames, or an object of class data.frame
if
unzip = TRUE
.
Florian Detsch
## Not run:
moshi = subset(
gsodstations
, `STATION NAME` == "MOSHI"
)
# download data from moshi, tanzania, from 1990 to 1995
gsod_moshi = dlGsodStations(
usaf = moshi$USAF
, start_year = 1990
, end_year = 1995
, dsn = tempdir()
, unzip = TRUE
)
# plot temperature data
plot(
TEMP ~ YEARMODA
, data = gsod_moshi
, type = "l"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.