tsk_output {assemblerr}R Documentation

Task output


These functions define output tasks that include the selected variables in the output of the generated model.


tsk_output(filename = "sdtab", variables)




The filename for the output file


The model variables that be included in the output



Tasks are building blocks that allow to specify what a model should “do”. Like other model building blocks, they can be combined using the + operator. However, they should not be added to a model but rather provided via the tasks= argument to the render function, e.g.,

render(m, tasks = tsk_estimation() +

Output tasks

For NONMEM, an output task defines the $TABLE records by specifying the filename= as well as the variables= to include.

The variables can be specified by providing a character vector of variable names (e.g., variables = c('cl','v')) or by using a set of variable selection helpers (e.g., variables = vars_prms()). The latter is shorter if many variables are to be selected and allows the specification of tasks independent from the model. The details of the variable selection language can be found on the help pages for model-variable-selection.

xpose4 output task

The tsk_output_xpose4() function includes $TABLE records that follow the output conventions of the model diagnostic package xpose4. It is a shortcut for the following two output tasks:

 xpose4_output <- tsk_output("sdtab", variables = any_of(c("id","time")) | vars_nm_std()) +
  tsk_output("patab", variables = vars_prms() | vars_eta())


A building block of type 'output_task'

See Also

Other tasks: tsk_estimation()


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 model parameters to file 'prms'
render(m, tasks = tsk_output("prms", variables = vars_prms()))
# output variables required by xpose4
render(m, tasks = tsk_output_xpose4())

[Package assemblerr version 0.1.0 Index]