#calling gg_gaps on a healthy dataset is pointless
sample.data.environment |> gg_gaps()
#creating a gapped and irregular dataset
bad_dataset <-
sample.data.environment |>
aggregate_Datetime(unit = "5 mins") |>
dplyr::filter(Id == "Participant") |>
filter_Date(length = "2 days") |>
dplyr::mutate(
Datetime = dplyr::if_else(
lubridate::date(Datetime) == max(lubridate::date(Datetime)),
Datetime, Datetime + 1
)
) |>
dplyr::filter(MEDI <250)
bad_dataset |> has_gaps()
bad_dataset |> has_irregulars()
#by default, gg_gaps() only shows gaps
bad_dataset |> gg_gaps()
#it can also show irregular data
bad_dataset |> gg_gaps(show.irregulars = TRUE)
Run the code above in your browser using DataLab