rcm_to_logical: Safely typecast numerically coded yes/no and true/false...

rcm_to_logicalR Documentation

Safely typecast numerically coded yes/no and true/false questions to logical.

Description

Safely typecast numerically coded yes/no and true/false questions to logical.

On rcm_field_truefalse and rcm_field_yesno, expect integer coding 0=FALSE and 1=TRUE.

On rcm_field_radio, extract logical from a radio field, assuming binary options and provided the label of the option corresponding to TRUE.

Usage

rcm_to_logical(...)

## S3 method for class 'rcm_data'
rcm_to_logical(df_data, chr_field)

## S3 method for class 'rcm_field_yesno'
rcm_to_logical(int_logical)

## S3 method for class 'rcm_field_truefalse'
rcm_to_logical(int_logical)

## S3 method for class 'rcm_field_checkbox'
rcm_to_logical(int_logical)

## S3 method for class 'rcm_field_radio'
rcm_to_logical(rcm_radio, chr_label_true)

MichaelPascale/rcm documentation built on July 14, 2022, 2:44 a.m.