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

View source: R/read_redcap_tables.R

format_redcap_factorR Documentation

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)

Arguments

data

vector

meta

vector of REDCap choices

Value

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

Examples

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

REDCapCAST documentation built on April 4, 2025, 3:18 a.m.