^{1}

^{2}

The authors have declared that no competing interests exist.

The Canadian Assessment of Physical Literacy (CAPL) is the first comprehensive protocol designed to assess a child’s level of physical literacy. Current approaches to analyzing CAPL-2 raw data are tedious, inefficient, and/or can lead to computation errors. In this paper we introduce the capl R package (open source), designed to compute and visualize CAPL-2 scores and interpretations from raw data. The capl package takes advantage of the R environment to provide users with a fast, efficient, and reliable approach to analyzing their CAPL-2 raw data and a “quiet” user experience, whereby “noisy” error messages are suppressed via validation. We begin by discussing several preparatory steps that are required prior to using the capl package. These steps include preparing, formatting, and importing CAPL-2 raw data. We then use demo data to show that computing the CAPL-2 scores and interpretations is as simple as executing one line of code. This one line of code uses the main function in the capl package (get_capl()) to compute 40 variables within a matter of seconds. Next, we showcase the helper functions that are called within the main function to compute individual variables and scores for each test element within the four domains as well as an overall physical literacy score. Finally, we show how to visualize CAPL-2 results using the ggplot2 R package.

Physical literacy is defined as “the motivation, confidence, physical competence, knowledge, and understanding to value and take responsibility for engagement in physical activities for life” [

The Canadian Assessment of Physical Literacy (CAPL) was the first comprehensive protocol designed to assess a broad spectrum of skills and abilities that contribute to and characterize the physical literacy level of a participating child [

The number of published research studies using the CAPL/CAPL-2 continues to grow. In Canada alone, 14 papers from the Royal Bank of Canada Learn to Play – Canadian Assessment of Physical Literacy study (RBC – Learn to Play CAPL) were published in a supplemental issue of BMC Public Health (

In this paper we introduce the capl R package, designed to compute and visualize CAPL-2 scores and interpretations from raw data. R is a programming language and free software environment for statistical computing and graphics (

Users can download and install the most recent version of the

Once the

The name and description of each function included in the

capitalize_character() | This function capitalizes a character vector. |

capl_demo_data() | A dataset containing CAPL-2 demo raw data. |

export_capl_data() | This function exports CAPL-2 data to an Excel workbook on a local computer. |

get_24_hour_clock() | This function converts 12-hour clock values to 24-hour clock values. |

get_adequacy_score() | This function computes an adequacy score (adequacy_score) for responses to items 2, 4 and 6 of the CSAPPA (Children’s Self-Perceptions of Adequacy in and Predilection for Physical Activity; Hay, 1992) Questionnaire as they appear in the CAPL-2 Questionnaire. This score is used to compute the motivation and confidence domain score (mc_score). |

get_binary_score() | This function computes a binary score (0 = incorrect answer, 1 = correct answer) for a response to a questionnaire item based on the value(s) set as answer(s) to the item. |

get_camsa_score() | This function selects the maximum CAMSA (Canadian Agility and Movement Skill Assessment) skill + time score for two trials (camsa_score) and then divides by 2.8 so that the score is out of 10. This score is used to compute the physical literacy score (pc_score). |

get_camsa_skill_time_score() | This function computes the CAMSA (Canadian Agility and Movement Skill Assessment) skill + time score (e.g., camsa_skill_time_score1) for a given trial. This score is used to compute the CAMSA score (camsa_score). |

get_camsa_time_score() | This function computes the CAMSA (Canadian Agility and Movement Skill Assessment) time score based on the time taken (in seconds) to complete a trial. |

get_capl() | This function is the main function in the capl package. It is a wrapper function that calls all other capl functions to compute all CAPL-2 scores and interpretations from raw data at once. If required CAPL-2 variables are missing, the function will create the variables and set values for these variables to NA so the function can proceed. |

get_capl_bar_plot() | This function renders a bar plot for a given CAPL-2 domain score, grouped by CAPL-2 interpretative categories. |

get_capl_demo_data() | This function generates a data frame of CAPL-2 demo (fake) raw data containing the 60 required variables that the capl package needs to compute scores and interpretations. |

get_capl_domain_status() | This function computes the status ("complete", "missing interpretation", "missing protocol" or "incomplete") of a CAPL domain (e.g., pc_status, db_status, mc_status, ku_status, capl_status). |

get_capl_interpretation() | This function computes an age- and gender-specific CAPL-2 interpretation for a given CAPL-2 protocol or domain score (e.g., pc_interpretation). |

get_capl_score() | This function computes an overall physical literacy score (capl_score) based on the physical competence (pc_score), daily behaviour (db_score), motivation and confidence (mc_score), and knowledge and understanding (ku_score) domain scores. If one of the scores is missing or invalid, a weighted score will be computed from the other three scores. |

get_db_score() | This function computes a daily behaviour domain score (db_score) based on the step and self-reported physical activity scores. This score is used to compute the overall physical literacy score (capl_score). |

get_fill_in_the_blanks_score() | This function computes a score (fill_in_the_blanks_score) for responses to the fill in the blanks items (story about Sally) in the CAPL-2 Questionnaire. This score is used to compute the knowledge and understanding domain score (ku_score). |

get_intrinsic_motivation_score() | This function computes an intrinsic motivation score (intrinsic_motivation_score) for responses to items 1-3 of the the Behavioral Regulation in Exercise Questionnaire (BREQ) as they appear in the CAPL-2 Questionnaire. This score is used to compute the motivation and confidence domain score (mc_score). |

get_ku_score() | This function computes a knowledge and understanding domain score (ku_score) based on the physical activity guideline (pa_guideline_score), cardiorespiratory fitness means (crf_means_score), muscular strength and endurance means (ms_score), sports skill (sports_skill_score) and fill in the blanks (fill_in_the_blanks_score) scores. If one of the scores is missing or invalid, a weighted domain score will be computed from the other four scores. This score is used to compute the overall physical literacy score (capl_score). |

get_mc_score() | This function computes a motivation and confidence domain score (mc_score) based on the predilection (predilection_score), adequacy (adequacy_score), intrinsic motivation (intrinsic_motivation_score) and physical activity competence (pa_competence_score) scores. If one of the scores is missing or invalid, a weighted domain score will be computed from the other three scores. This score is used to compute the overall physical literacy score (capl_score). |

get_missing_capl_variables() | 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. |

get_pa_competence_score() | This function computes a physical activity competence score (pa_competence_score) for responses to items 4-6 of the the Behavioral Regulation in Exercise Questionnaire (BREQ) as they appear in the CAPL-2 Questionnaire. This score is used to compute the motivation and confidence domain score (mc_score). |

get_pacer_20m_laps() | This function converts PACER (Progressive Aerobic Cardiovascular Endurance Run) shuttle run laps to their equivalent in 20-metre laps (pacer_laps_20m). If laps are already 20-metre laps, they are returned unless outside the valid range (1-229). This variable is used to compute the PACER score (pacer_score). |

get_pacer_score() | This function computes a PACER (Progressive Aerobic Cardiovascular Endurance Run) score (pacer_score) based on the number of PACER laps run at a 20-metre distance. This score is used to compute the physical competence domain score variable (pc_score). |

get_pc_score() | This function computes a physical competence domain score (pc_score) based on the PACER (Progressive Aerobic Cardiovascular Endurance Run), plank and CAMSA (Canadian Agility and Movement Skill Assessment) scores. If one protocol score is missing or invalid, a weighted domain score will be computed from the other two protocol scores. This score is used to compute the physical competence domain score (pc_score). |

get_pedometer_wear_time() | This function computes pedometer wear time in decimal hours for a given day (e.g., wear_time1). This variable is used to compute the step_average variable and the step score (step_score). |

get_plank_score() | This function computes a plank score (plank_score) based on the duration of time (in seconds) for which a plank is held. This score is used to compute the physical competence domain score (pc_score). |

get_predilection_score() | This function computes a predilection score (predilection_score) for responses to items 1, 3 and 5 of the CSAPPA (Children’s Self-Perceptions of Adequacy in and Predilection for Physical Activity; Hay, 1992) Questionnaire as they appear in the CAPL-2 Questionnaire. This score is used to compute the motivation and confidence domain score (mc_score). |

get_self_report_pa_score() | This function computes a score (self_report_pa_score) for a response to "During the past week (7 days), on how many days were you physically active for a total of at least 60 minutes per day? (all the time you spent in activities that increased your heart rate and made you breathe hard)?" in the CAPL-2 Questionnaire. This score is used to compute the daily behaviour domain score (db_score). |

get_step_average() | This function computes the daily arithmetic mean of a week of steps taken as measured by a pedometer (step_average). This variable is used to compute the step score (step_score). |

get_step_score() | This function computes a step score (step_score) based on the average daily steps taken as measured by a pedometer. This score is used to compute the daily behaviour domain score (db_score). |

import_capl_data() | This function imports CAPL-2 data from an Excel workbook on a local computer. |

rename_variable() | This function renames variables in a data frame. |

validate_age() | This function checks whether an age is valid (numeric and between 8 and 12). CAPL-2 scores and interpretations are valid for children between the ages of 8 and 12 years. |

validate_character() | This function checks whether a vector is a character and not of length zero or "". |

validate_domain_score() | This function checks whether a CAPL-2 domain score is numeric and within a valid range. |

validate_gender() | This function checks whether a vector can be classified as "girl" or "boy". |

validate_integer() | This function checks whether a vector is an integer. |

validate_number() | This function checks whether a vector is numeric. |

validate_scale() | This function checks whether a vector for a given questionnaire item or scale is valid. |

validate_steps() | 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). |

Users must first import their raw data before using the

The

The

The base

The 60 required variables can also be quickly accessed by calling the base R

The

The base

If users prefer to examine the CAPL-2 demo raw data in a workbook, the

If users import their own raw data and plan to use the main function (

One of the coding philosophies behind the

There are eight validation functions included in the

Users can learn more about these functions by accessing the documentation within the R environment.

Sections 2.7.2 and 2.7.3 illustrate examples of validation.

The CAPL-2 is currently validated with 8- to 12-year-old children. However, when a function requires the

Notice the NA values in the results.

The first element is NA because the original value is 7 and the next five elements are identical to their original values because they are integers between 8 and 12. Recall that the CAPL-2 is validated with children aged 8 to 12 years, hence why the first value is NA (i.e., outside the validated range). The next two elements because the original values ("" and NA) are obviously invalid. The last element is 8, but notice that the original value is a decimal. Because 8.5 is between 8 and 12, it is considered valid but the floor of the value is returned since CAPL-2 performs age-specific computations based on integer age.

The CAPL-2 is currently validated for children who identify as boys or girls. When a function requires the

Notice the results again. This function accepts a number of case-insensitive options (e.g., “Girl”, “G”, “female”, “F”, 1) for the female gender and returns a standardized “girl” value. The two elements that are returned as NA have original values that are obviously invalid ("" and NA).

The CAPL-2 scoring system is outlined in

Reprinted from

The main function in the

Reprinted from

The 40 new computed variables related to/including the CAPL-2 scores and interpretations can be confirmed by calling the base R

The 40 new variables related to/including the CAPL-2 scores and interpretations that are outputted from the

Some users may want to validate and compute individual variables and scores. The following sections introduce the helper functions in the order they appear when called in the

As illustrated in

The

The

The

The

The

The

The

The

The

The

The

The

As illustrated in

Reprinted from

The

The

There must be at least four valid days of pedometer step counts for an arithmetic mean to be computed. If there are less than four valid days, one of the step values from a valid day is randomly sampled and used for the fourth valid day before computing the mean. Other important

The

The

The

The

As illustrated in

The

The

The

The

The

The

As illustrated in

The

The

The

The

The

The

The

CAPL-2 scores can be grouped by their associated interpretative categories and visualized in a bar plot by calling the

The color palette can be customized by setting the

If users want to export their data, the

In this paper we introduce the

One limitation of the current

With the development of the