ns_alter_checkbox: Alter checkbox matrix variables in a dataset

View source: R/ns-checkbox.R

ns_alter_checkboxR Documentation

Alter checkbox matrix variables in a dataset

Description

This function processes checkbox matrix variables in a dataset, transforming their representations into one of the specified formats.

Usage

ns_alter_checkbox(data, to = c("character", "list"), sep = ",", cb = NULL)

Arguments

data

A 'data.frame' containing the dataset to modify.

to

A character string specifying the output format for checkbox matrix variables. Must be one of "character" or "list".

sep

A character string used as a separator when 'to = "character"'. Defaults to '","'.

cb

An optional codebook ('data.frame') to identify checkbox matrix variables. If 'NULL', the codebook is generated using 'ns_get_codebook()'.

Value

A modified 'data.frame' with processed checkbox matrix variables.

Examples

## Not run: 
dt <- ns_get_data(11000)
ns_alter_checkbox(data = dt, to = "list")
ns_alter_checkbox(data = dt, to = "character", sep = ";")

## End(Not run)

LCBC-UiO/nettskjemar documentation built on April 11, 2025, 11:01 p.m.