profile_describe_sb: Extract a summary of bout duration distribution for sedentary...

View source: R/sb_profile__Hibbing2021d__SB.R

profile_describe_sbR Documentation

Extract a summary of bout duration distribution for sedentary profiles

Description

Extract a summary of bout duration distribution for sedentary profiles

Usage

profile_describe_sb(
  df = NULL,
  is_sb,
  is_wear,
  minimum_bout_duration_minutes = 5,
  valid_indices = NULL,
  id = NULL,
  counts = NULL,
  wear = NULL,
  sb = 100,
  simplify = TRUE,
  probs = c(0.1, 0.2, 0.25, seq(0.3, 0.7, 0.1), 0.75, 0.8, 0.9),
  epoch_length_sec
)

profile_describe_sb_df(
  df,
  counts = NULL,
  wear = NULL,
  id = NULL,
  sb = 100,
  minimum_bout_duration_minutes = 5,
  valid_indices = NULL,
  simplify = TRUE,
  probs = c(0.1, 0.2, 0.25, seq(0.3, 0.7, 0.1), 0.75, 0.8, 0.9),
  epoch_length_sec
)

Arguments

df

optional data frame input (possibly with data for multiple strata, e.g., different participants)

is_sb

logical vector indicating epoch-by-epoch classifications of sedentary behavior (TRUE) or non-sedentary (FALSE)

is_wear

logical vector indicating epoch-by-epoch classifications of wear time (TRUE) or non-wear (FALSE)

minimum_bout_duration_minutes

numeric. Bouts shorter than this duration will be excluded from processing

valid_indices

[optional] numeric/integer/logical vector specifying which indices of is_sb and is_wear correspond to valid measurement days (e.g. with 10+ hours of wear time on 4+ days). The default (NULL) assumes all elements are valid

id

character scalar (optional). Column name on which to divide object (if a data frame) into a list of separate objects

counts

character scalar. Column name of the variable to use when classifying sedentary behavior (and wear time, depending on the function)

wear

character scalar [optional]. Column name of the variable to use for determining wear time (logical vector with TRUE for wear time minutes). If no value is provided, profile_choi_wear is invoked on the counts column

sb

numeric. The cut point to use for classifying sedentary behavior

simplify

logical. Collapse output for each stratum into a single data frame?

probs

numeric vector. Quantiles to summarize in the output

epoch_length_sec

numeric. The epoch_length of x

Details

profile_describe_sb will "dispatch" to profile_describe_sb_df if a value is provided for df. Arguments can be used accordingly, but should always be named.

Examples

data(example_data, package = "PBpatterns")
example_data$is_wear <- TRUE
profile_describe_sb(
  example_data, counts = "PAXINTEN",
  wear = "is_wear", id = "PAXDAY",
  epoch_length_sec = 60
)

paulhibbing/PBpatterns documentation built on Feb. 17, 2024, 5:34 a.m.