Learn R Programming

REDCapCAST (version 25.3.1)

format_redcap_factor: Converts REDCap choices to factor levels and stores in labels attribute

Description

Applying as_factor to the data.frame or variable, will coerce to a factor.

Usage

format_redcap_factor(data, meta)

Value

vector of class "labelled" with a "labels" attribute

Arguments

data

vector

meta

vector of REDCap choices

Examples

Run this code
format_redcap_factor(sample(1:3, 20, TRUE), "1, First. | 2, second | 3, THIRD")

Run the code above in your browser using DataLab