spec_type_to_codelist | R Documentation |
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
)
doc |
Named list of datasets @seealso |
codelist_cols |
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 |
permitted_val_cols |
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 |
dict_cols |
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 |
sheets |
Optional, regular expressions of the sheets |
simplify |
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 builders:
spec_type_to_derivations()
,
spec_type_to_ds_spec()
,
spec_type_to_ds_vars()
,
spec_type_to_value_spec()
,
spec_type_to_var_spec()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.