Skip to contents

The exact tag takes precedence over its parent tags. Unmatched IDs retain their source text. A null language leaves the source text unchanged. Two IDs can have the same displayed text. Only the original IDs belong in a data join or a fill mapping.

Usage

forma_labels(ids, variable, lang = NULL, dictionary = NULL)

Arguments

ids

A vector of category identifiers.

variable

Single variable name to look up.

lang

Optional language tag such as "zh-Hans".

dictionary

Optional data frame with character columns variable, id, lang and label, unique by variable, ID and language.

Value

A character vector in the input order.

Examples

dict <- data.frame(variable = "site", id = "N", lang = "en", label = "North")
forma_labels(c("N", "S"), "site", "en-US", dict)
#> [1] "North" "S"