fill_gaps: Fill gaps of a timeseries

Description Usage Arguments See Also

Description

Fills gaps of an xts-object and results a modified xts-object.

Usage

1
2
fill_gaps(xts, mode = 5, fill_with = NA, fill_index = TRUE, by = "mins",
  na_rm = TRUE, maxgap = 10, verbose = FALSE)

Arguments

xts

An xts object to be filled.

mode

The mode to fill the gaps with: "0" for a specific value, e.g. NA or 0, "1" for locf, "2" for nocb, "3" for linear interpolation, "4" for spline approximation.

fill_with

The value to fill the gap (requires mode = 0)

fill_index

logical. Should the index be filled so that the timeseries becomes equidistant? Corresponding values for filled indices become NA.

by

The interval the index should be aligned to

na_rm

logical. Should leading NAs be removed (affects mode=1 and mode=2)?

maxgap

maximum number of consecutive NAs to fill. Any longer gaps will be left unchanged.

verbose

logical. Should informative outputs printed during function evaluation?

See Also

xts, na.locf, na.fill.


dleutnant/m181 documentation built on May 15, 2019, 9:16 a.m.