mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2025-01-18 21:16:34 +01:00
24 lines
615 B
R
24 lines
615 B
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/read_redcap_tables.R
|
|
\name{format_redcap_factor}
|
|
\alias{format_redcap_factor}
|
|
\title{Converts REDCap choices to factor levels and stores in labels attribute}
|
|
\usage{
|
|
format_redcap_factor(data, meta)
|
|
}
|
|
\arguments{
|
|
\item{data}{vector}
|
|
|
|
\item{meta}{vector of REDCap choices}
|
|
}
|
|
\value{
|
|
vector of class "labelled" with a "labels" attribute
|
|
}
|
|
\description{
|
|
Applying \link[REDCapCAST]{as_factor} to the data.frame or variable, will
|
|
coerce to a factor.
|
|
}
|
|
\examples{
|
|
format_redcap_factor(sample(1:3,20,TRUE),"1, First. | 2, second | 3, THIRD")
|
|
}
|