mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-21 14:09:08 +02:00
support labelled data
This commit is contained in:
parent
5926c12da6
commit
2aa268f747
13 changed files with 188 additions and 65 deletions
23
man/format_redcap_factor.Rd
Normal file
23
man/format_redcap_factor.Rd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
% 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")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue