gap.fill | R Documentation |
Fills gaps by linear interpolation between observations. This function provides the option to define the minimum window under which gaps should be filled, using linear interpolation.
gap.fill(input, max.gap = 60, decimals = 10, df = FALSE)
input |
an |
max.gap |
Numeric value providing the maximum size of a gap in minutes, which can be filled by performing a linear interpolation. |
decimals |
Integer value defining the number of decimals of the output (default = 10). |
df |
Logical; if |
A zoo
object or data.frame
in the appropriate format for further processing.
## Not run:
# fill two hour gaps
raw <- example.data(type = "doy")
input <-
is.trex(
raw,
tz = "GMT",
time.format = "%H:%M",
solar.time = TRUE,
long.deg = 7.7459,
ref.add = FALSE,
df = FALSE)
# create gaps in data
input[which(input < 0.4 | input > 0.82)] <- NA
fill_120 <- gap.fill(
input = input,
max.gap = 120,
decimals = 10,
df = FALSE)
fill_15 <- gap.fill(
input = input,
max.gap = 15,
decimals = 10,
df = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.