| gap_finder {LightLogR} | R Documentation |
Check for and output gaps in a dataset
Description
Quickly check for implicit missing Datetime data. Outputs a message with a
short summary, and can optionally return the gaps as a tibble. Uses
gap_handler() internally.
Usage
gap_finder(
dataset,
Datetime.colname = Datetime,
epoch = "dominant.epoch",
gap.data = FALSE,
silent = FALSE,
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
|
gap.data |
Logical. If |
silent |
Logical. If |
full.days |
If |
Details
The gap_finder() function is a wrapper around gap_handler() with the
behavior argument set to "gaps". The main difference is that
gap_finder() returns a message with a short summary of the gaps in the
dataset, and that the tibble with the gaps contains a column gap.id that
indicates the gap number, which is useful to determine, e.g., the consecutive
number of gaps between measurement data.
Value
Prints message with a short summary of the gaps in the dataset. If
gap.data = TRUE, returns a tibble of the gaps in the dataset.
See Also
Other regularize:
dominant_epoch(),
gap_handler(),
gapless_Datetimes()
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)) +
lubridate::hours(c(0,12,rep(0,4)))) %>%
dplyr::group_by(Id)
dataset
#look for gaps assuming the epoch is the dominant epoch of each group
gap_finder(dataset)
#return the gaps as a tibble
gap_finder(dataset, gap.data = TRUE)
#assuming the epoch is 1 day, we have different gaps, and the datapoint at noon is now `irregular`
gap_finder(dataset, epoch = "1 day")