get_missing_capl_variables: Add required CAPL-2 variables to a data frame of raw data if...

View source: R/utilities.R

get_missing_capl_variablesR Documentation

Add required CAPL-2 variables to a data frame of raw data if they are missing.

Description

This function adds required CAPL-2 variables (see Details for a full list) to a data frame of raw data if they are missing. When missing variables are added, the values for a given missing variable are set to NA. This function is called within get_capl() so that CAPL-2 score and interpretation computations will run without errors in the presence of missing variables.

Usage

get_missing_capl_variables(raw_data = NULL)

Arguments

raw_data

a data frame of raw CAPL-2 data.

Details

The required CAPL-2 variables include:

  • age

  • gender

  • pacer_lap_distance

  • pacer_laps

  • plank_time

  • camsa_skill_score1

  • camsa_time1

  • camsa_skill_score2

  • camsa_time2

  • steps1

  • time_on1

  • time_off1

  • non_wear_time1

  • steps2

  • time_on2

  • time_off2

  • non_wear_time2

  • steps3

  • time_on3

  • time_off3

  • non_wear_time3

  • steps4

  • time_on4

  • time_off4

  • non_wear_time4

  • steps5

  • time_on5

  • time_off5

  • non_wear_time5

  • steps6

  • time_on6

  • time_off6

  • non_wear_time6

  • steps7

  • time_on7

  • time_off7

  • non_wear_time7

  • self_report_pa

  • csappa1

  • csappa2

  • csappa3

  • csappa4

  • csappa5

  • csappa6

  • why_active1

  • why_active2

  • why_active3

  • feelings_about_pa1

  • feelings_about_pa2

  • feelings_about_pa3

  • pa_guideline

  • crf_means

  • ms_means

  • sports_skill

  • pa_is

  • pa_is_also

  • improve

  • increase

  • when_cooling_down

  • heart_rate

Examining the structure (see str()) of some CAPL-2 demo data (see get_capl_demo_data()) provides additional information about these variables.

Value

returns a merged data frame of raw data and missing required CAPL-2 variables (values are set to NA).

Examples

raw_data <- get_missing_capl_variables(raw_data)


barnzilla/capl documentation built on April 2, 2022, 8:50 a.m.