Use this function to create a template script that puts package
functions in order and, based on question answers, prepopulates
some arguments. By default, this function is run in interactive
mode, meaning that it will not work in a script unless a list of
answers is given to
answer_list argument. Note that the
saved template file is not intended to be run as is, but only to
provide a starting structure for a cleaning script.
Name with path of template script.
List of answer strings to provide if you don't
want to answer questions interactively. See details for
questions and expected input type. Leave as default
Questions to answer if using the
Do you want to set the DUA crosswalk file?
DUA crosswalk file (with path): '< file name with path >'
Do the data need to be deidentified?
Would like to select the ID column now?
ID column name: '< column name string >'
If answers to questions (1) and (2) are
No, then strings for 1(a),
2(a), and 2(b) can be left empty since they will be ignored.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## Not run: ## run interactively make_dua_template('data_clean.R') ## ...and don't include extra notes make_dua_template('data_clean.R', include_notes = FALSE) ## End(Not run) ## make template to be filled in file <- file.path(tempdir(), 'data_clean.R') make_dua_template(file, answer_list = list('No','','No','','')) ## show writeLines(readLines(file))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.