template_categorical_variables: Describe categorical variables of a data table

View source: R/template_categorical_variables.R

template_categorical_variablesR Documentation

Describe categorical variables of a data table

Description

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

Usage

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.

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().

Value

catvars_*

Columns:

  • attributeName: Column name

  • code: Categorical variable

  • definition: Definition of categorical variable

Examples

## Not run: 
# 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")

## End(Not run)


EDIorg/EMLtools documentation built on Nov. 1, 2022, 9:38 a.m.