Hibbing_2021_internal: Functions used internally for the sedentary profiles of...

Hibbing_2021_internalR Documentation

Functions used internally for the sedentary profiles of Hibbing et al. (2021)

Description

Functions used internally for the sedentary profiles of Hibbing et al. (2021)

Usage

profile_df_check(df, counts, valid_indices, id, wear)

profile_counts_check(df, counts)

profile_indices_check(df, valid_indices)

profile_id_wear_check(df, id, wear)

profile_id_verify(df, id)

profile_choi_wear(counts)

profile_id_bind(result, id, simplify = TRUE)

Arguments

counts

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

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

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

result

output that may need data frame formatting (possibly ID-based)

Details

The purpose of profile_id_wear_check is to determine if the Choi wear time algorithm needs to be run and, if so, to run it (via profile_choi_wear, with a message). To bypass, run df$is_wear <- TRUE prior to executing profile_id_wear_check(df, id, wear = "is_wear").

profile_df_check is a wrapper that encompasses all the checks on this page


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