View source: R/gzGsodStations.R
gzGsodStations | R Documentation |
Extract and merge previously downloaded GSOD data based on a unique USAF station code and a supplied temporal range.
gzGsodStations(
usaf,
dsn = ".",
start_year = NULL,
end_year = NULL,
save_output = FALSE,
rm_gz = FALSE,
...
)
usaf |
Numeric. A unique USAF station code. It can either be manually
determined from built-in |
dsn |
Character, default is the current working directory. Destination folder for data download. |
start_year |
Numeric. The desired year to start data extraction and
concatenation. If not supplied, all files in |
end_year |
Numeric. The desired year to stop data extraction and
concatenation. If not supplied, all files in |
save_output |
Logical, default is FALSE. If TRUE, a local copy of the
concatenated GSOD data will be created based on the settings provided to |
rm_gz |
Logical, default is FALSE. If TRUE, *.gz files are removed after
extraction and concatenation. If |
... |
Additional arguments passed to |
An object of class data.frame
.
Florian Detsch
## Not run:
moshi <- subset(gsodstations, `STATION NAME` == "MOSHI")
#' # download data from moshi, tanzania, from 1990 to 1995
jnk = dlGsodStations(
usaf = moshi$USAF
, start_year = 1990
, end_year = 1995
, dsn = tempdir()
)
# Download data from Moshi, Tanzania, from 1990 to 1995
gsod_moshi <- gzGsodStations(usaf = moshi$USAF,
start_year = 1990, end_year = 1995,
dsn = tempdir(),
save_output = TRUE,
file = file.path(tempdir(), "moshi_1990_1995.csv"),
row.names = FALSE)
# Plot temperature data (but: time series not continuous!)
plot(gsod_moshi$TEMP, type = "l")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.