Learn R Programming

rcoder (version 0.3.0)

coding_to_haven_labels: 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)

Value

A named vector representation of the coding

Arguments

coding

A coding object

Examples

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

Run the code above in your browser using DataLab