N = 60
dataset1 <-
tibble::tibble(
Id = rep("A", N),
Datetime = lubridate::as_datetime(0) + lubridate::minutes(1:N),
MEDI = sample(c(sample(1:249, N / 2), sample(250:1000, N / 2))),
)
dataset1 %>%
dplyr::reframe("Frequency crossing 250lx" = frequency_crossing_threshold(MEDI, threshold = 250))
dataset1 %>%
dplyr::reframe(frequency_crossing_threshold(MEDI, threshold = 250, as.df = TRUE))
Run the code above in your browser using DataLab