convert_checkbox_vals: Convert a new checkbox column's values

View source: R/combine_checkboxes.R

convert_checkbox_valsR Documentation

Convert a new checkbox column's values

Description

This function takes a single column of data and converts the values based on the overall data tibble cross referenced with a nested section of the metadata tibble.

case_when logic helps determine whether the value is a coalesced singular value or a user-specified one via multi_value_label or values_fill.

Usage

convert_checkbox_vals(
  metadata,
  .new_value,
  data_tbl,
  raw_or_label,
  multi_value_label,
  values_fill
)

Arguments

metadata

A nested portion of the overall metadata tibble

.new_value

The new column values made by combine_checkboxes()

data_tbl

The data tibble from the original supertibble

raw_or_label

Either 'raw' or 'label' to specify whether to use raw coded values or labels for the options. Default 'label'.

multi_value_label

A string specifying the value to be used when multiple checkbox fields are selected. Default "Multiple".

values_fill

Value to use when no checkboxes are selected. Default NA.

Details

This function is used in conjunction with pmap().


REDCapTidieR documentation built on April 3, 2025, 10:50 p.m.