gsod2ki | R Documentation |
This function converts GSOD data from native format to standard KiLi SP1 format
(Julendat, see https://code.google.com/archive/p/julendat/) and,
optionally, to an object of class ki.data
.
gsod2ki(
data,
date_col = "YEARMODA",
prm_col = "TEMP",
timezone = "NA",
aggtime = "-999",
plot_id = "NA",
ep_plot_id = "xxx",
station_id = "NA",
proc_level = -999,
qual_flag = "NA",
save_output = FALSE,
df2ki = FALSE,
...
)
data |
|
date_col |
Character or numeric, default is "YEARMODA". Indicates the date column. |
prm_col |
Character or numeric, default is "TEMP". Indicates the parameter column(s). |
timezone |
Character, default is "NA". |
aggtime |
Character, default is "-999". |
plot_id |
Character, default is "NA". |
ep_plot_id |
Character, default is "xxx". |
station_id |
Character, default is "NA". |
proc_level |
Numeric, default is -999. |
qual_flag |
Numeric, default is "NA". |
save_output |
Logical, default is FALSE. If TRUE, a local copy of the
reformatted GSOD data will be created based on the settings provided to
|
df2ki |
Logical, default is FALSE. If TRUE, the reformatted data is
converted to an object of class |
... |
Additional arguments passed to |
An object of class data.frame
or, if df2ki = TRUE
, an object of
class ki.data
.
Florian Detsch
as.ki.data
## Not run:
moshi <- subset(gsodstations, `STATION NAME` == "MOSHI")
gsod_moshi <- dlGsodStations(usaf = moshi$USAF,
start_year = 1990, end_year = 1995,
dsn = tempdir(),
unzip = TRUE)
# Conversion to KiLi SP1 Julendat standard format
jul_moshi <- gsod2ki(data = gsod_moshi,
prm_col = c("TEMP", "MIN", "MAX"),
df2ki = FALSE)
plot(jul_moshi$TEMP, type = "l", lwd = 2,
ylim = c(min(jul_moshi$MIN, na.rm = TRUE), max(jul_moshi$MAX, na.rm = TRUE)))
lines(jul_moshi$MIN, col = "blue", lty = 2)
lines(jul_moshi$MAX, col = "red", lty = 2)
# Conversion to `ki.data` object
ki_moshi <- gsod2ki(data = gsod_moshi,
prm_col = c("TEMP", "MIN", "MAX"),
df2ki = TRUE)
str(ki_moshi)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.