R/utils-data-processing.R
make_integer_times.Rd
Add a time variable with integer values for evenly sampled data
make_integer_times(data, period = NULL, tol = 1e-06)
data | dataset to modify |
---|---|
period | period to check the times against (if |
tol | tolerance for the period |
the dataset, with integer times
First, check if the data are evenly sampled in time. If not, we
exit early. Next, if the times are already integer or Date, we don't do
anything. If the times are numeric, but roundable to integer, we round.
Otherwise, we add a new variable to covariates
from 1:n and designate
this variable as the timename
.