flag_nonwear: flag_nonwear

View source: R/flag_nonwear.R

flag_nonwearR Documentation

flag_nonwear

Description

flag_nonwear

Usage

flag_nonwear(
  HR,
  steps,
  nonwear_method = c("missing_HR", "missing_HR_zero_steps", "choi_HR", "choi_steps",
    "none"),
  ...
)

Arguments

HR

a numeric vector representing HR readings of a Fitbit.

steps

a numeric vector representing step readings of a Fitbit. Depending on the nonwear method, either HR or steps or both are used.

nonwear_method

a character entry, the name of one of the non wear method options: "missing_HR", "missing_HR_zero_steps", "choi_HR", or "choi_steps".

...

additional parameters that go into the selected nonwear_method.

Value

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

Examples

## Not run: 
minute_data %>%
  group_by(id) %>%
  mutate(
    missing_HR = flag_nonwear(HR, steps, "missing_HR"),
    missing_HR_zero_steps = flag_nonwear(HR, steps, "missing_HR_zero_steps"),
    choi_HR = flag_nonwear(HR, steps, "choi_HR"),
    choi_steps = flag_nonwear(HR, steps, "choi_steps")
  )

## End(Not run)

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