| read_dictionary {iNZightTools} | R Documentation |
This function reads a data dictionary from a file and attaches it to a dataset. The attached data dictionary provides utility functions that can be used by other methods, such as plots, to automatically create axes and more.
read_dictionary( file, name = "name", type = "type", title = "title", description = "description", units = "units", codes = "codes", values = "values", level_separator = "|", ... ) ## S3 method for class 'dictionary' print(x, kable = FALSE, include_other = TRUE, ...) ## S3 method for class 'dictionary' x[i, ...] apply_dictionary(data, dict) has_dictionary(data) get_dictionary(data)
file |
The path to the file containing the data dictionary. |
name |
The name of the column containing the variable name. |
type |
The name of the column containing the variable type. |
title |
The name of the column containing a short, human-readable title for the variable. If blank, the variable name will be used instead. |
description |
The name of the column containing the variable description. |
units |
The name of the column containing units (for numeric variables only). |
codes |
The name of the column containing factor codes (for categorical variables only). |
values |
The name of the column containing factor values corresponding to the codes. These should be in the same order as the codes. |
level_separator |
The separator used to separate levels in |
... |
Additional arguments, passed to |
x |
A |
kable |
If |
include_other |
If |
i |
Subset index. |
data |
A dataset (dataframe, tibble). |
dict |
A dictionary (created using |
The dataset with the attached data dictionary.