apply_labels function

Batch set variable labels

Batch set variable labels

This function is a copycat of from expss package v0.10.7 (slightly modified) to avoid having to depend on expss. See expss::apply_labels() for more documentation. Note that this version is not compatible with data.table.

apply_labels(data, ..., warn_missing = FALSE)

Arguments

  • data: data.frame/list
  • ...: named arguments
  • warn_missing: if TRUE, throw a warning if some names are missing

Returns

An object of the same type as data, with labels

Examples

iris %>% apply_labels(Sepal.Length="Length of Sepal", Sepal.Width="Width of Sepal") %>% crosstable()

Author(s)

Dan Chaltiel