REDCapCAST/man/vec2choice.Rd

25 lines
475 B
Plaintext
Raw Normal View History

2024-11-21 11:18:38 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ds2dd_detailed.R
\name{vec2choice}
\alias{vec2choice}
\title{Named vector to REDCap choices (`wrapping compact_vec()`)}
\usage{
vec2choice(data)
}
\arguments{
\item{data}{named vector}
}
\value{
character string
}
\description{
Named vector to REDCap choices (`wrapping compact_vec()`)
}
\examples{
sample(seq_len(4), 20, TRUE) |>
as_factor() |>
named_levels() |>
sort() |>
vec2choice()
}