Describes categorical variables of a data table. Use if any columns are classified as categorical in table attributes template.

template_categorical_variables(path, data.path = path, write.file = TRUE)

Arguments

path

(character) Path to the metadata template directory.

data.path

(character) Path to the data directory.

write.file

(logical; optional) Whether to write the template file.

Value

catvars_*

Columns:

  • attributeName: Column name

  • code: Categorical variable

  • definition: Definition of categorical variable

Details

template_categorical_variables() knows which columns of a table are categorical based on their definition under the class column of the attributes_*.txt template.

Character encoding of metadata extracted directly from the tables are converted to UTF-8 via enc2utf8().

Examples

if (FALSE) {
# Set working directory
setwd("/Users/me/Documents/data_packages/pkg_260")

# For tables containing categorical variables as classified in the table attributes template
template_categorical_variables(
  path = "./metadata_templates",
  data.path = "./data_objects")
}