Skip to contents

This function takes the average minutes of exercise per day across a week of accelerometer use as an input (MVPA_min) and calculates the equivalent minutes of exercise per one week of accelerometer use. The result is returned as a numeric value.

Usage

minperday_to_minperweek(MVPA_min)

Arguments

MVPA_min

numeric A numeric representing the average minutes of exercise per day across a week of accelerometer use.

Value

numeric The average minutes of exercise per one week of accelerometer use. If inputs are invalid or out of bounds, the function returns a tagged NA.

Details

The function simply multiplies the average minutes of exercise per day (MVPA_min) by 7 to obtain the equivalent minutes of exercise per one week of accelerometer use.

     **Missing Data Codes:**
     - Propagates tagged NAs from the input `MVPA_min`.

Examples

# Scalar usage: Single respondent
# Example: Convert average minutes of exercise per day to minutes per week.
minperday_to_minperweek(35)
#> [1] 245
# Output: 245

# Multiple respondents
minperday_to_minperweek(c(35, 40, 20))
#> [1] 245 280 140
# Returns: c(245, 280, 140)

# Database usage: Applied to survey datasets
library(dplyr)
# dataset %>%
#   mutate(min_per_week = minperday_to_minperweek(avg_exercise))