# Label placeholder with no associated value
lbl("New label")
# Label placeholder with a value/label pair
lbl(10, "New label")
# Use placeholders as inputs to other label handlers
x <- haven::labelled(
c(100, 200, 105, 990, 999, 230),
c(`Unknown` = 990, NIU = 999)
)
x <- lbl_add(
x,
lbl(100, "$100"),
lbl(105, "$105"),
lbl(200, "$200"),
lbl(230, "$230")
)
lbl_relabel(x, lbl(9999, "Missing") ~ .val > 900)
Run the code above in your browser using DataLab