#The sample dataset does not have gaps
sample.data.environment |> has_gaps()
#removing some of the data creates gaps
sample.data.environment |> dplyr::filter(MEDI <= 50000) |> has_gaps()
#having a grouped dataframe where the groups span multiple unconnected parts
#is considered a gap, which can be relevant, e.g., when searching for clusters
sample.data.environment |>
add_photoperiod(c(47.1, 10)) |>
dplyr::group_by(photoperiod.state) |>
has_gaps()
#to avoid this, use `number_states()` for grouping
sample.data.environment |>
add_photoperiod(c(48.52, 9.06)) |>
number_states(photoperiod.state) |>
dplyr::group_by(photoperiod.state.count, .add = TRUE) |>
has_gaps()
Run the code above in your browser using DataLab