Learn R Programming

NBDCtools (version 1.0.2)

transf_value_to_label: Convert values to labels for categorical variables

Description

Converts the values of categorical/factor columns (e.g., "1", "2") to their labels (e.g., "Male", "Female"). The value labels will be set to the values.

Usage

transf_value_to_label(data, transf_sess_id = FALSE)

Value

A tibble with factor columns transformed to labels.

Arguments

data

tibble. The labelled dataset

transf_sess_id

logical. Whether to transform the session_id column

Details

Input requirements

The data must be type transformed and labelled. See transf_factor() and transf_label() for details.

data <- data |>
  transf_factor() |>
  transf_label()

Examples

Run this code
if (FALSE) {
transf_value_to_label(data)
transf_value_to_label(data, value_to_na = TRUE)
}

Run the code above in your browser using DataLab