Create Script for Parameters Assignment
script.Rd
Create Script for Parameters Assignment
Create Script for TLG
Generation
Usage
script_args(x, dict = NULL)
# S4 method for chevron_tlg
script_args(x, dict = NULL)
script_funs(x, adam_db, args, details = FALSE)
# S4 method for chevron_tlg
script_funs(x, adam_db, args, details = FALSE)
Arguments
- x
(
chevron_tlg
) input.- dict
(
list
) with the name and value of custom arguments.- adam_db
(
string
) the name of the dataset.- args
(
string
) the name of argument list.- details
(
flag
) whether to show the code of all function. By default, only the detail of the code of the prepossessing step is printed.
Examples
script_args(aet04)
#> [1] "\n# Arguments definition ----\n" "adam_db <- stop(\"missing value\")"
#> [3] "arm_var <- \"ACTARM\"" "prune_0 <- TRUE"
script_funs(aet04, adam_db = "syn_data", args = "args")
#> [1] "# Edit Preprocessing Function."
#> [2] "pre_fun <- function (adam_db, ...) "
#> [3] "{"
#> [4] " atoxgr_lvls <- c(\"1\", \"2\", \"3\", \"4\", \"5\")"
#> [5] " adam_db$adae <- adam_db$adae %>% filter(.data$ANL01FL == "
#> [6] " \"Y\") %>% mutate(AEBODSYS = reformat(.data$AEBODSYS, nocoding), "
#> [7] " AEDECOD = reformat(.data$AEDECOD, nocoding), ATOXGR = factor(.data$ATOXGR, "
#> [8] " levels = atoxgr_lvls))"
#> [9] " adam_db"
#> [10] "}"
#> [11] ""
#> [12] "# Create TLG"
#> [13] "syn_data <- rlang::exec(.fn = pre_fun, adam_db = syn_data, !!!args)"
#> [14] "tlg_output <- run(object = aet04, adam_db = syn_data, auto_pre = FALSE, verbose = TRUE, user_args = args)"