View source: R/analyze_bouts__main.R
analyze_bouts | R Documentation |
analyze_bouts
is a universal function that serves as a wrapper for
several bout classifying methods (included below in the usage
section).
analyze_bouts(
x,
target,
method = c("rle_standard", "CRIB", "Troiano_MVPA", "Ostendorf_MVPA", "SB_summary",
"MVPA_summary"),
...
)
crib_bouts(
x,
target,
target_buffer_mins,
longest_allowable_interruption_mins = Inf,
required_percent = 100,
max_n_interruptions = Inf,
minimum_bout_duration_minutes = 0,
epoch_length_sec,
is_wear = TRUE,
valid_indices = NULL
)
ostendorf_mvpa_bouts(
x,
target,
required_percent = 80,
termination_min = 3,
minimum_bout_duration_minutes = 10,
epoch_length_sec,
is_wear = TRUE,
valid_indices = NULL
)
sb_summary_bouts(
x,
target,
minimum_bout_duration_minutes = 0,
probs = c(0.1, 0.2, 0.25, seq(0.3, 0.7, 0.1), 0.75, 0.8, 0.9),
patterns = TRUE,
epoch_length_sec,
is_wear = TRUE,
valid_indices = NULL
)
mvpa_summary_bouts(
x,
target,
minimum_bout_duration_minutes = 0,
epoch_length_sec,
is_wear = TRUE,
valid_indices = NULL
)
rle_standard_bouts(
x,
target,
minimum_bout_duration_minutes = 0,
epoch_length_sec,
is_wear = TRUE,
valid_indices = NULL
)
troiano_mvpa_bouts(
x,
target,
activation_window_min = 10,
activation_min = 8,
termination_min = 3,
minimum_bout_duration_minutes = 10,
epoch_length_sec,
is_wear = TRUE,
valid_indices = NULL
)
x |
factor. Epoch-by-epoch behavior classifications, e.g., |
target |
the level of |
method |
character. The bout classifying method to use. See details. |
... |
arguments passed to the method function being wrapped (see
|
target_buffer_mins |
numeric ( |
longest_allowable_interruption_mins |
numeric ( |
required_percent |
numeric (1-100; |
max_n_interruptions |
numeric ( |
minimum_bout_duration_minutes |
[optional argument available for all methods] a numeric filtering criterion. Bouts will be discarded if the length (in epochs) is less than this amount |
epoch_length_sec |
[REQUIRED argument for all methods] a numeric
scalar giving the epoch length of |
is_wear |
[optional argument available for all methods] a logical
scalar (or vector, as long as its length equals the length of |
valid_indices |
[optional argument available for all methods] a
numeric/integer/logical vector specifying which elements of |
termination_min |
numeric ( |
probs |
quantile values to return ( |
patterns |
logical ( |
activation_window_min |
numeric ( |
activation_min |
numeric ( |
Currently, the following methods are supported:
"rle_standard"
, "CRIB"
, "Troiano_MVPA"
,
"Ostendorf_MVPA"
, "SB_summary"
, and "MVPA_summary"
.
More can easily be added over time, including more *_summary
methods
or others that are designed for specific behaviors or activity monitors.
For help understanding output when method == "CRIB"
, see
CRIB_output
These functions return a one-row data frame with bout summary information, rather than a data frame with one row for each individual bout
Troiano
et al. (2008)
Ostendorf et al. (2018)
expand_bouts
plot.bouts
data(example_data, package = "PBpatterns")
x <- cut(
example_data$PAXINTEN,
c(-Inf, 101, 760, Inf),
c("SB", "LPA", "MVPA"),
right = FALSE
)
analyze_bouts(x, "MVPA", "rle_standard", epoch_length_sec = 60)[1:6, ]
analyze_bouts(x, "MVPA", "CRIB", 20, 5, 50, 3, 10, 60)
analyze_bouts(x, "MVPA", "Troiano_MVPA", epoch_length_sec = 60)
analyze_bouts(x, "MVPA", "Ostendorf_MVPA", epoch_length_sec = 60)
analyze_bouts(x, "SB", "SB_summary", is_wear = TRUE, epoch_length_sec = 60)
analyze_bouts(x, "MVPA", "MVPA_summary", is_wear = TRUE, epoch_length_sec = 60)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.