gap_table()
creates a gt::gt()
with one row per group, summarizing key
gap and gap-related information about the dataset. These include the
available data, total duration, number of gaps, missing implicit and explicit
data, and, optionally, irregular data.
gap_table(
dataset,
Variable.colname = MEDI,
Variable.label = "melanopic EDI",
title = "Summary of available and missing data",
Datetime.colname = Datetime,
epoch = "dominant.epoch",
full.days = TRUE,
include.implicit.gaps = TRUE,
check.irregular = TRUE,
get.df = FALSE
)
A gt table about data and gaps in the dataset
A light logger dataset. Needs to be a dataframe.
Column name of the variable to check for NA values. Expects a symbol.
Clear name of the variable. Expects a string
Title string for the table
The column that contains the datetime. Needs to be a
POSIXct
and part of the dataset.
The epoch to use for the gapless sequence. Can be either a
lubridate::duration()
or a string. If it is a string, it needs to be
either '"dominant.epoch"' (the default) for a guess based on the data or a
valid lubridate::duration()
string, e.g., "1 day"
or "10 sec"
.
If TRUE
, the gapless sequence will include the whole first
and last day where there is data.
Logical. Whether to expand the datetime sequence
and search for implicit gaps, or not. Default is TRUE
. If no
Variable.colname
is provided, this argument will be ignored. If there
are implicit gaps, gap calculation can be incorrect whenever there are
missing explicit gaps flanking implicit gaps!
Logical on whether to include irregular data in the summary, i.e. data points that do not fall on the regular sequence.
Logical whether the dataframe should be returned instead of a
gt::gt()
table
sample.data.environment |> dplyr::filter(MEDI <= 50000) |> gap_table()
Run the code above in your browser using DataLab