[Stable]

A wrapper around rmarkdown::render for nm objects. Use markdown templates to create a customised set of diagnostics to reuse on multiple models. In the demo an example is shown in Scripts/basic_gof.Rmd, but ideally you'll create your own customised version with everything you need to evaluate your model. To create an R markdown diagnostic template go to FILE -> New File -> R markdown -> From Template the select from one of the following:

  • model diagnostic

  • VPC diagnostic

  • PPC diagnostic

  • bootstrap results (nm_list_render)

These are intentionally minimal templates that can be run as notebooks or as automated diagnostics run with nm_render. Follow the instructions at the top of the template for more details.

nm_render(
  m,
  input,
  output_file = NA,
  args = list(),
  force = getOption("nm.force_render"),
  ...
)

nm_list_render(
  m,
  input,
  output_file = NA,
  args = list(),
  force = getOption("nm.force_render"),
  ...
)

Arguments

m

An nm object.

input

Character. Same as rmarkdown::render() arg.

output_file

Character. Same as rmarkdown::render() arg.

args

List. Same as "params" arg in rmarkdown::render().

force

Logical (default = getOption("nm.force_render")). Will force execution.

...

Additional argument passed to rmarkdown::render().

Value

The same nm object, m, with modified results_files field.

Details

input must refer to a properly specified Rmd document. The R markdown template "model diagnostic" in RStudio sets this up for you.

These R markdown templates are usable as R Notebooks (e.g. for code development and debugging) if the object .m is defined in the global work space first.

nm_list_render() is mostly used for bootstraps, and other routines where a parent run spawns multiple children in the form of an nm_list

Examples


## requires NONMEM to be installed
if (FALSE) {
m1 %>% nm_render("Scripts/basic_gof.Rmd")

## to run "Scripts/basic_gof.Rmd" as an R Notebook
## first define .m

.m <- m1 ## Now you can run "Scripts/basic_gof.Rmd" as a Notebook
}