Creates the value_spec from a list of datasets (optionally filtered by the
sheet input). The named vector *_cols
is used to determine which is the
correct sheet and renames the columns.
spec_type_to_codelist(
doc,
codelist_cols = c(code_id = "ID", name = "[N|n]ame", code = "^[C|c]ode|^[T|t]erm",
decode = "[D|d]ecode"),
permitted_val_cols = NULL,
dict_cols = c(code_id = "ID", name = "[N|n]ame", dictionary = "[D|d]ictionary", version
= "[V|v]ersion"),
sheets = NULL,
simplify = FALSE
)
Named list of datasets @seealso read_all_sheets()
for exact
format
Named vector of column names that make up the codelist. The column names can be regular expressions for more flexibility. But, the names must follow the given pattern
Named vector of column names that make up the permitted value The column names can be regular expressions for more flexibility. This is optional, can be left as null if there isn't a permitted value sheet
Named vector of column names that make up the dictionary value The column names can be regular expressions for more flexibility. This is optional, can be left as null if there isn't a permitted value sheet
Optional, regular expressions of the sheets
Boolean value, if true will convert code/decode pairs that are all equal to a permitted value list. True by default
a dataset formatted for the metacore object
Other spec builder:
spec_type_to_derivations()
,
spec_type_to_ds_spec()
,
spec_type_to_ds_vars()
,
spec_type_to_value_spec()
,
spec_type_to_var_spec()