#gives one last group (highest group id)
sample.data.environment |>
sample_groups() |>
dplyr::group_keys()
#gives one random group (highest group id)
sample.data.environment |>
sample_groups(sample = "random") |>
dplyr::group_keys()
#gives the group with the highest average melanopic EDI
sample.data.environment |>
sample_groups(order.by = mean(MEDI)) |>
dplyr::group_keys()
#gives the group with the lowest average melanopic EDI
sample.data.environment |>
sample_groups(sample = "bottom", order.by = mean(MEDI)) |>
dplyr::group_keys()
# give only groups that have a median melanopic EDI > 1000 lx
sample.data.environment |>
sample_groups(condition = median(MEDI, na.rm = TRUE) > 1000) |>
dplyr::group_keys()
# return only days with time above 250 lx mel EDI > 7 hours
sample.data.environment |>
add_Date_col(group.by = TRUE) |>
sample_groups(order.by = duration_above_threshold(MEDI, Datetime, threshold = 250),
condition = .order_value > 7*60*60) |>
dplyr::group_keys()
# return the 5 days with the highest time above 250 lx mel EDI
sample.data.environment |>
add_Date_col(group.by = TRUE) |>
sample_groups(
n = 5,
order.by = duration_above_threshold(MEDI, Datetime, threshold = 250),
) |>
dplyr::group_keys()
# gives the first group
sample.data.environment |>
sample_groups(sample = 1) |>
dplyr::group_keys()
# gives the second group
sample.data.environment |>
sample_groups(sample = 2) |>
dplyr::group_keys()
Run the code above in your browser using DataLab