Helper for aligning your data to a standardised dictionary or your own dictionary.
Source:R/msf_dict_rename_helper.R
msf_dict_rename_helper.RdHelper for aligning your data to a standardised dictionary or your own dictionary.
Usage
msf_dict_rename_helper(
disease,
name,
varnames = "data_element_shortname",
varnames_type,
rmd,
template = TRUE,
copy_to_clipboard = TRUE
)Arguments
- disease
Specify which disease you would like to use. Currently supports "Cholera", "Measles", "Meningitis", "AJS", "Mortality", "Nutrition", "Vaccination_short" and "Vaccination_long".
- name
The name of the dictionary stored in the package. The default will use dictionaries from the package. However you can also use dictionaries not stored within this package, to use these: specify
nameas path to .xlsx file and set thetemplate = False- nb. this needs to be a dataframe containingvarnamesandvarnames_type. You will also need to specify a path tormd.- varnames
The name of column that contains variable names. The default set to "data_element_shortname". If
dictionaryis a survey ("Mortality", "Nutrition", "Vaccination_short" or "Vaccination_long")varnamesneeds to be "name"`. Otherwise if using your own dictionary then specify.- varnames_type
The name of column that contains the variable type. The default will use "data_element_valuetype" for DHIS2 and "type" for Kobo dictionaries. If you specify your own dictionary then this needs to be the same length as
varnamesin your dictionary.- rmd
The Rmarkdown template which you would like to compare to. Default is will use those included in the package. However you can also use Rmarkdowns not stored within this package, to use these: specify
rmdas path to .rmd file and settemplate = False; nb. you will need to specify a path to a file innamewhich containsvarnamesandvarnames_type.- template
If
TRUE(default) read in a generic dictionary and Rmarkdown based on the MSF OCA ERB pre-approved template. However you can also specify your own dictionary if this differs substantially, by settingtemplate = FALSE.- copy_to_clipboard
if
TRUE(default), the rename template will be copied to the user's clipboard withclipr::write_clip(). IfFALSE, the rename template will be printed to the user's console.