validate_steps {capl}R 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


[Package capl version 1.42 Index]