powered by
This function processes checkbox matrix variables in a dataset, transforming their representations into one of the specified formats.
ns_alter_checkbox(data, to = c("character", "list"), sep = ",", cb = NULL)
A modified `data.frame` with processed checkbox matrix variables.
A `data.frame` containing the dataset to modify.
A character string specifying the output format for checkbox matrix variables. Must be one of "character" or "list".
A character string used as a separator when `to = "character"`. Defaults to `","`.
An optional codebook (`data.frame`) to identify checkbox matrix variables. If `NULL`, the codebook is generated using `ns_get_codebook()`.
if (FALSE) { dt <- ns_get_data(11000) ns_alter_checkbox(data = dt, to = "list") ns_alter_checkbox(data = dt, to = "character", sep = ";") }
Run the code above in your browser using DataLab