gapless_Datetimes {LightLogR} | R Documentation |
Create a gapless sequence of Datetimes
Description
Create a gapless sequence of Datetimes. The Datetimes are determined by the minimum and maximum Datetime in the dataset and an epoch. The epoch can either be guessed from the dataset or specified by the user.
Usage
gapless_Datetimes(
dataset,
Datetime.colname = Datetime,
epoch = "dominant.epoch",
full.days = FALSE
)
Arguments
dataset |
A light logger dataset. Needs to be a dataframe. |
Datetime.colname |
The column that contains the datetime. Needs to be a
|
epoch |
The epoch to use for the gapless sequence. Can be either a
|
full.days |
If |
Value
A tibble
with a gapless sequence of Datetime
as specified by
epoch
.
See Also
Other regularize:
dominant_epoch()
,
gap_finder()
,
gap_handler()
Examples
dataset <-
tibble::tibble(Id = c("A", "A", "A", "B", "B", "B"),
Datetime = lubridate::as_datetime(1) +
lubridate::days(c(0:2, 4, 6, 8))) %>%
dplyr::group_by(Id)
dataset %>% gapless_Datetimes()
dataset %>% dplyr::ungroup() %>% gapless_Datetimes()
dataset %>% gapless_Datetimes(epoch = "1 day")