R/template_categorical_variables.R
template_categorical_variables.Rd
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)
(character) Path to the metadata template directory.
(character) Path to the data directory.
(logical; optional) Whether to write the template file.
Columns:
attributeName: Column name
code: Categorical variable
definition: Definition of categorical variable
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()
.
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")
}