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)
#> [1] "\n# Arguments definition ----\n"
#> [2] "adam_db <- stop(\"missing value\")"
#> [3] "arm_var <- \"ACTARM\""
#> [4] "lbl_aebodsys <- \"MedDRA System Organ Class\""
#> [5] "lbl_aedecod <- \"MedDRA Preferred Term\""
#> [6] "deco <- std_deco(\"AET04\")"
#> [7] "prune_0 <- TRUE"
script_funs(aet04_1, adam_db = "syn_data", args = "args")
#> [1] "# Edit Preprocessing Function."
#> [2] "pre_fun <- function (adam_db, ...) "
#> [3] "{"
#> [4] " checkmate::assert_class(adam_db, \"dm\")"
#> [5] " new_format <- list(adae = list(AEBODSYS = rule(`No Coding Available` = c(\"\", "
#> [6] " NA, \"<Missing>\")), AEDECOD = rule(`No Coding Available` = c(\"\", "
#> [7] " NA, \"<Missing>\")), ATOXGR = rule(`No Grading Available` = c(\"\", "
#> [8] " NA, \"<Missing>\"))))"
#> [9] " adam_db <- dunlin::reformat(adam_db, new_format, na_last = TRUE)"
#> [10] " adam_db %>% dm_zoom_to(\"adae\") %>% filter(.data$ANL01FL == "
#> [11] " \"Y\") %>% filter(.data$ATOXGR != \"No Grading Available\") %>% "
#> [12] " mutate(ATOXGR = factor(.data$ATOXGR, levels = setdiff(levels(.data$ATOXGR), "
#> [13] " \"No Grading Available\"))) %>% dm_update_zoomed()"
#> [14] "}"
#> [15] ""
#> [16] "# Create TLG"
#> [17] "tlg_output <- rlang::exec(.fn = pre_fun, adam_db = syn_data, !!!args) %>% \nrlang::exec(.fn = run, object = aet04_1, !!!args, auto_pre = FALSE, check_arg = FALSE)"