get_pedometer_wear_time: Compute pedometer wear time in decimal hours for a given day.

Description Usage Arguments Details Value Examples

View source: R/daily_behaviour.R

Description

This function computes pedometer wear time in decimal hours for a given day (e.g., wear_time1). This variable is used to compute the step_average variable and the step score (step_score).

Usage

1
get_pedometer_wear_time(time_on = NA, time_off = NA, non_wear_time = NA)

Arguments

time_on

A character vector representing the time (in 12- or 24-hour clock format) when the pedometer was first worn on a given day.

time_off

A character vector representing the time (in 12- or 24-hour clock format) when the pedometer was removed at the end of a given day.

non_wear_time

A numeric vector representing the total time (in minutes) the pedometer was not worn during waking hours on a given day.

Details

Other capl functions called by this function include: get_24_hour_clock() and validate_number().

Value

Returns a numeric vector with values >= 0 (if valid) or NA (if not valid).

Examples

1
2
3
4
5
6
7
get_pedometer_wear_time(
  time_on = c("6:23", "5:50 am", NA),
  time_off = c("21:37", "9:17pm", ""),
  c(60, 90, 0)
)

# [1] 14.23 13.95    NA

capl documentation built on March 16, 2021, 9:06 a.m.