apply_pareto_rule: Wrap bin_apply_all and pareto_sd

View source: R/qc.R

apply_pareto_ruleR Documentation

Wrap bin_apply_all and pareto_sd

Description

Wrap bin_apply_all and pareto_sd

Usage

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()#'

Arguments

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

Value

A new binned_dataset with an extra field 'pareto' stating whether the animal fulfills the pareto principle of awakeness for the given bin.

See Also

Other pareto_sd: pareto_sd()


shaliulab/fslretho documentation built on Jan. 30, 2023, 9:16 p.m.