apply_pareto_rule | R Documentation |
Wrap bin_apply_all and pareto_sd
velocity_correction_coef <- 0.0048 # change as needed dt_raw <- load_ethoscope(linked_metadata) dt <- sleepr::sleep_annotation(dt, velocity_correction_coef=velocity_correction_coef) dt_binned <- behavr::bin_apply_all(data = dt, y = "asleep", x = "t", x_bin_length = behavr::mins(30), FUN=mean) dt_binned <- apply_pareto_rule(dt, dt_binned) ggplot(dt_binned, aes(x=t, y=asleep)) + stat_pop_etho()#'
scored_dataset |
behavr timeseries data with at least columns x and t |
binned_dataset |
behavr timeseries produced by applying bin_apply_all with a function other than pareto_sd, typically the mean |
sd_only |
If TRUE, this refinement is only applicable during SD |
A new binned_dataset with an extra field 'pareto' stating whether the animal fulfills the pareto principle of awakeness for the given bin.
Other pareto_sd:
pareto_sd()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.