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

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)


[Package capl version 1.42 Index]