get_profile: Implement the sedentary profiles

View source: R/get_profile.R

get_profileR Documentation

Implement the sedentary profiles

Description

Implement the sedentary profiles

Usage

get_profile(object, ...)

## S3 method for class 'bout'
get_profile(object, method = c("both", "decisionTree", "randomForest"), ...)

## S3 method for class 'data.frame'
get_profile(
  object,
  method = c("both", "decisionTree", "randomForest"),
  id = NULL,
  counts = NULL,
  wear = NULL,
  sb = 100,
  valid_indices = NULL,
  ...
)

## S3 method for class 'list'
get_profile(object, method = c("both", "decisionTree", "randomForest"), ...)

Arguments

object

input (either data frame or output from sb_bout_dist)

...

further arguments passed to sb_bout_dist (used only in data frame method)

method

character. The model(s) to use for the prediction

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, nhanes_wear is invoked on the counts column

sb

integer. The cut point to use for classifying sedentary behavior

valid_indices

integer vector (optional) 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)

Value

one or more profile assignments

Examples

data(example_data, package = "SBprofiles")
get_profile(example_data, counts = "PAXINTEN")
get_profile(
  example_data, counts = "PAXINTEN", method = "randomForest"
)
get_profile(example_data, id = "PAXDAY", counts = "PAXINTEN")
get_profile(
  example_data, id = "PAXDAY",
  counts = "PAXINTEN", method = "decisionTree"
)

paulhibbing/SBprofiles documentation built on June 16, 2022, 3:31 a.m.