Learn R Programming

ipumsr (version 0.4.5)

lbl: Make a label placeholder object

Description

Helper to make a placeholder for a label-value pair.

Usage

lbl(...)

Arguments

...

Either one or two arguments, possibly named .val and .lbl. If a single unnamed value, represents the label, if 2 unnamed values, the first is the value and the second is the label.

Value

A label_placeholder object, useful in functions like lbl_add

See Also

Other lbl_helpers: lbl_add(), lbl_clean(), lbl_collapse(), lbl_define(), lbl_na_if(), lbl_relabel(), zap_ipums_attributes()

Examples

Run this code
# NOT RUN {
x <- haven::labelled(
  c(100, 200, 105, 990, 999, 230),
  c(`Unknown` = 990, NIU = 999)
)

lbl_add(x, lbl(100, "$100"), lbl(105, "$105"), lbl(200, "$200"), lbl(230, "$230"))

# }

Run the code above in your browser using DataLab