flag_choi_steps: Apply Choi et al nonwear algorithm to steps

View source: R/flag_choi.R

flag_choi_stepsR Documentation

Apply Choi et al nonwear algorithm to steps

Description

Apply Choi et al nonwear algorithm to steps

Usage

flag_choi_steps(
  steps,
  activity_threshold = 1,
  min_period_len = 90,
  spike_tolerance = 2,
  min_window_len = 30,
  window_spike_tolerance = 0
)

Arguments

steps

a numeric vector containing Fitbit steps for a subject.

activity_threshold

same as in flag_choi(), the difference is that the default activity threshold is specifically set for Fitbit steps to 1, however modifying the value is still optional.

min_period_len

same as in flag_choi().

spike_tolerance

same as in flag_choi().

min_window_len

same as in flag_choi().

window_spike_tolerance

same as in flag_choi().

Value

nonwear vector, non wear time encoded as T, and wear time encoded as F.

Examples

## Not run: 
minute_data %>%
  group_by(id) %>%
  mutate(nonwear = flag_choi_steps(steps))

## End(Not run)

audiracmichelle/fitibble documentation built on Feb. 2, 2023, 3:51 p.m.