The output task allows to select model variables using a concise mini language. You can select variables by name or using one of the helper functions described below.
The selection of variables builds on the tidyselect package which implements a powerful variable selection language (see tidyselect::language). The following features are most relevant for the selection of model variables:
|
for selecting the union of several variables
c()
for combining selections
!
for taking the complement of a set of variables
In addition, you can select variables using a combination of the following helper functions:
vars_prms()
selects all model parameters
vars_data()
selects all data defined variables
vars_eta()
selects all eta variables
vars_nm_std()
selects the standard NONMEM variables DV, PRED, RES, WRES, IPREDI, IWRESI
vars_starts_with()
selects variables that start with a prefix
vars_matches()
selects variables that match a regular expression
vars_prms(vars) vars_data(vars) vars_eta(vars) vars_nm_std(vars) vars_starts_with(match, vars) vars_matches(match, vars)
vars | A character vector of variable names (taken from the selection context) |
---|---|
match | A character vector to match against |
A selection context
m <- model() + input_variable("dose") + prm_log_normal("emax", median = 10, var_log = 0.09) + prm_log_normal("ed50", median = 50, var_log = 0.09) + algebraic(effect~emax*dose/(ed50 + dose)) + obs_proportional(~effect, var_prop = 1) # output all model parameter and eta variables render(m, tasks = tsk_output("prms", variables = vars_prms() | vars_eta()))#> $PROBLEM #> $INPUT DOSE ID DV #> $DATA data.csv IGNORE=@ #> $PRED #> EMAX = THETA(1) * EXP(ETA(1)) #> ED50 = THETA(2) * EXP(ETA(2)) #> EFFECT = EMAX * DOSE/(ED50 + DOSE) #> Y = EFFECT + EFFECT * EPS(1) #> $TABLE EMAX ED50 ETA(1) ETA(2) FILE=prms NOAPPEND NOPRINT #> $THETA (0, 10, Inf) ; POP_EMAX #> $THETA (0, 50, Inf) ; POP_ED50 #> $OMEGA 0.09 ; IIV_EMAX #> $OMEGA 0.09 ; IIV_ED50 #> $SIGMA 1; RUV_PROP