Learn R Programming

ipumsr (version 0.4.2)

lbl_clean: Clean unused labels

Description

Remove labels that do not appear in the data.

Usage

lbl_clean(x)

Arguments

x

A labelled vector

Value

A haven::labeled vector

See Also

Other lbl_helpers: lbl_add, lbl_collapse, lbl_na_if, lbl_relabel, lbl, zap_ipums_attributes

Examples

Run this code
# NOT RUN {
x <- haven::labelled(
  c(1, 2, 3, 1, 2, 3, 1, 2, 3),
  c(Q1 = 1, Q2 = 2, Q3 = 3, Q4= 4)
)

lbl_clean(x)

# }

Run the code above in your browser using DataLab