A useful function for working with data that aren't sampled at
regular intervals and(or) contain gaps. This can present issues when, for
example, trying to apply time-windowed rolling operations.
data.frame; the data to be made uniform on the basis of
time_column.
time_column
identifier for the column in data that gives
(cumulative) time values. Right-hand-sided formulas will be deparsed,
otherwise this argument is passed to '[[' as-is.
deltat
numeric (scalar); the typical sampling frequency of the
data. If NULL (default), a guess is made via
deltat_guess.
empty_fill
the value with which to "fill" new rows in the returned
data. For most purposes this should be either NA or a numeric value.
Value
a consistently sampled tbl_df, with the
appropriate deltat attribute.
Details
For time-windowed rolling operations, empty_fill should logically be
set to 0L; the use of NAs could generate large runs of NAs, causing
complications.