gfLinInt | R Documentation |
This function fills small data gaps occurring in (eco-)climatological measurement series by simple linear interpolation.
gfLinInt(data, prm = "TEMP", limit = 5, width = 11, ...)
data |
Object of class |
prm |
Character, default is "TEMP". Parameter(s) to fill. |
limit |
Numeric, default is 5. Maximum gap length to be filled by linear interpolation. |
width |
Numeric, default is 11. See |
... |
Additional arguments. Currently not in use. |
An object of class ki.data
.
Florian Detsch
rollapply
## 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 `ki.data` object
ki_moshi <- gsod2ki(data = gsod_moshi,
prm_col = c("TEMP", "MIN", "MAX"),
df2ki = TRUE)
# Fill small gaps (n <= 3) by linear interpolation
ki_moshi_lf <- gfLinInt(data = ki_moshi,
prm = c("TEMP", "MIN", "MAX"),
limit = 3, width = 7)
plot(methods::slot(ki_moshi_lf, "Parameter")$TEMP, type = "l", col = "red")
lines(methods::slot(ki_moshi, "Parameter")$TEMP)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.