Skip to contents

Returns the units object with added column unit_codes. The routine can also propose variable pages if get_units() was called with unit_definition = TRUE. Please note that no other operation except for filtering or add_metadata() should be applied to the units. Empty lists and NULL entries in unit_variables are treated as absent variable metadata when preparing codes, including in mixed workspaces. The original unit_variables column is preserved.

Usage

add_coding_scheme(units, filter_has_codes = TRUE, overwrite = FALSE)

Arguments

units

Tibble. Contains units retrieved from get_units().

filter_has_codes

Logical. Only returns variables that were not deactivated. Defaults to TRUE.

overwrite

Logical. Should potentially existing unit_codes be overwritten? Defaults to FALSE.

Value

A tibble.