coding_to_haven_labels: Convert coding to 'haven'-compatible labels

View source: R/interop.R

coding_to_haven_labelsR Documentation

Convert coding to 'haven'-compatible labels

Description

Converts a 'coding' object into a named vector to be used in the 'labels' parameter for 'haven::labelled()'.

Usage

coding_to_haven_labels(coding)

Arguments

coding

A coding object

Value

A named vector representation of the coding

Examples

cdng <- coding(code("Yes", 1), code("No", 0))
coding_to_haven_labels(cdng)

rcoder documentation built on Oct. 6, 2023, 9:06 a.m.