R/utils-data-processing.R
make_equitimed.Rd
Insert rows if necessary so that time series are evenly sampled
make_equitimed( data, period = NULL, tol = 1e-06, method = c("mean", "method", "closest"), na.rm = TRUE )
data | dataset to modify |
---|---|
period | period to check the times against (if |
tol | tolerance for the period |
method | one of |
na.rm | a logical value indicating whether |
the dataset, with rows coerced according to the equitimed time indices, and additional empty rows inserted if needed
First, get_full_times()
computes the sequence of time index values
at a regular sampling interval of period. These will be the final time
index values for the output. Some set of rows of the original dataset
will map to each of these time indices.
The method
argument determines how these rows get coerced:
the values in the rows are averaged together using mean
the values in the rows are averaged together using median
the values in the row that is closest in time to the desired time index are used.