Named vector to REDCap choices (`wrapping compact_vec()`)
Examples
sample(seq_len(4), 20, TRUE) |>
as_factor() |>
named_levels() |>
sort() |>
vec2choice()
#> [1] "1, 1 | 2, 2 | 3, 3 | 4, 4"
Named vector to REDCap choices (`wrapping compact_vec()`)
sample(seq_len(4), 20, TRUE) |>
as_factor() |>
named_levels() |>
sort() |>
vec2choice()
#> [1] "1, 1 | 2, 2 | 3, 3 | 4, 4"