Access model code from an xpdb object.

get_code(xpdb, .problem = NULL)

Arguments

xpdb

An xpose_data object from which the model code will be extracted.

.problem

The problem to be used, in addition, problem 0 is attributed to general output (e.g. NM-TRAN warnings in NONMEM). By default returns the entire code.

Value

A tibble of the parsed model.

Examples

parsed_model <- get_code(xpdb_ex_pk)
parsed_model
#> # A tibble: 764 × 5
#>    problem level subroutine code                                         comment
#>  *   <int> <int> <chr>      <chr>                                        <chr>  
#>  1       0     0 oth        "Mon Oct 16 13:34:28 CEST 2017"              ""     
#>  2       0     0 oth        ""                                           "; 1. …
#>  3       0     0 oth        ""                                           "; 2. …
#>  4       0     0 oth        ""                                           "; NON…
#>  5       1     1 pro        "Parameter estimation"                       ""     
#>  6       1     2 inp        "ID DOSE DV SCR AGE SEX CLASS WT ACE MED1 M… ""     
#>  7       1     2 inp        " CLCR AMT SS II EVID"                       ""     
#>  8       1     3 dat        "../../mx19_2.csv IGNORE=@"                  ""     
#>  9       1     4 abb        "DERIV2=NO"                                  ""     
#> 10       1     5 sub        "ADVAN2 TRANS1"                              ""     
#> # ℹ 754 more rows