Skip to contents

Internal. This function will tag pre-defined variables in a data.frame by adding a label attribute to the column. This can be used for one or multiple variables at the same time.

Usage

tag_variables(x, tags)

Arguments

x

a data.frame or a tibble, with at least one column

tags

A named list with variable names in x as list names and the tags as list values. Values set to NULL remove the tag.

Value

The function returns the original object with an additional "label" attribute on each provided variable.

Details

If used several times, the previous tag is removed silently. Only accepts known variables from the provided data.frame.