lbl: Make a label placeholder object

View source: R/lbl_helpers.r

lblR Documentation

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

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"))


mnpopcenter/ipumsr documentation built on Sept. 30, 2022, 6:56 a.m.