validate_steps: Check whether daily steps as measured by a pedometer are...

View source: R/daily_behaviour.R

validate_stepsR Documentation

Check whether daily steps as measured by a pedometer are valid.

Description

This function checks whether daily steps as measured by a pedometer are valid. The variables from this function are used to compute step_average and the step score (step_score).

Usage

validate_steps(steps = NA, wear_time = NA)

Arguments

steps

A numeric (integer) vector representing the steps taken on a given day (valid values are between 1000 and 30000).

wear_time

A numeric vector representing the duration of time (in decimal hours) that a pedometer was worn on a given day (valid values are >= 10.0 hours).

Details

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

Value

Returns the steps argument (if valid) or NA (if not valid).

Examples

validate_steps(
  steps = c(5400, 11001, 999, 31000, 8796),
  wear_time = c(10.1, 12.6, 10.2, 10.9, 9.5)
)

# [1]  5400 11001    NA    NA    NA


capl documentation built on April 8, 2022, 9:06 a.m.