hsFillUp: Fill-up with Missing Timestamps

View source: R/baseFillUp.R

hsFillUpR Documentation

Fill-up with Missing Timestamps

Description

Based on the time series given in "tseries" a new time series is generated in which timestamps that are lacking in tseries are included. Optionally missing values are generated by interpolation between existing values.

Usage

hsFillUp(
  tseries,
  tsField = names(tseries)[kwb.utils::posixColumnAtPosition(tseries)[1]],
  step_s = 60,
  forceStep = TRUE,
  limits = NULL,
  interpol = TRUE,
  includeOrig = TRUE,
  default = NA,
  dbg = FALSE
)

Arguments

tseries

data frame representing a time-series of values

tsField

Name of timestamp column in tseries. Default: name of first available POSIXt-column

step_s

Time step in seconds that shall lie between consecutive timestamps. Non-existing timestamps are generated.

forceStep

If TRUE, only timestamps that are multiples of the time step given in step_s are put into the result data frame

limits

data frame or matrix with exactly two columns containing first and last timestamp of intervals for which timestamps are to be generated.

interpol

if TRUE, the returned data frame will for each value column contain a corresponding column containing interpolated values

includeOrig

if TRUE and interpol = TRUE the original columns will remain in the output in addition to the columns containing all (original plus interpolated) values.

default

value to be used if there are not enough (at least to) non-NA values to be used for interpolation. Default: NA

dbg

If TRUE, debug messages are shown

Value

Returns a data.frame


KWB-R/kwb.base documentation built on June 19, 2022, 3:30 a.m.