# Calculate mean daily duration above threshold. As the data only contains
# data for two days, Weekend and Mean daily will throw NA
sample.data.irregular |>
aggregate_Datetime(unit = "1 min") |>
mean_daily_metric(
Variable = lux,
threshold = 100
)
# again with another dataset
sample.data.environment |>
mean_daily_metric(
Variable = MEDI,
threshold = 250)
# by default, datetime columns are converted to time
sample.data.environment |>
mean_daily_metric(
Variable = MEDI,
metric_type = timing_above_threshold,
threshold = 250)
Run the code above in your browser using DataLab