Function that uses sdtmchecksmeta as input and creates .R file with function calls

create_R_script(
  metads = sdtmchecksmeta,
  file = "sdtmchecks_run_all.R",
  verbose = TRUE
)

Arguments

metads

sdtmchecksmeta file

file

filename and/or path to save to

verbose

Print information to console

Value

R script with user specified sdtmchecks based on sdtmchecksmeta file

See also

Reporting-related utility functions convert_var_to_ascii(), truncate_var_strings()

Author

Monarch Shah

Examples



# All checks are output to a file
fileName <- file.path(tempdir(), "run_all_checks.R")
create_R_script(file = fileName)
#> sdtmchecks calls R script written here: /tmp/RtmpwBSO9B/run_all_checks.R

# Only include selected checks
fileName <- file.path(tempdir(), "run_some_checks.R")
mymetads = sdtmchecksmeta[sdtmchecksmeta$category == "ALL" & sdtmchecksmeta$priority == "High",]
create_R_script(metads = mymetads, file = fileName)
#> sdtmchecks calls R script written here: /tmp/RtmpwBSO9B/run_some_checks.R

# Roche specific function calls
fileName <- file.path(tempdir(), "run_all_checks_roche.R")
mymetads = sdtmchecksmeta
mymetads$fxn_in=mymetads$fxn_in_roche
create_R_script(metads = mymetads, file = fileName)
#> sdtmchecks calls R script written here: /tmp/RtmpwBSO9B/run_all_checks_roche.R