Skip to contents

This is the command used by the fit_simple target generated by tar_nlmixr(); it is not typically invoked by end users.

Usage

nlmixr_fit_simple(
  object,
  data,
  est,
  control,
  table,
  error = c("stop", "continue"),
  description = NULL
)

Arguments

object

The simplified nlmixrui object returned by nlmixr_object_simplify().

data

nlmixr data

est

estimation method (all methods are shown by `nlmixr2AllEst()`). Methods can be added for other tools

control

The estimation control object. These are expected to be different for each type of estimation method

table

The output table control object (like `tableControl()`)

error

What should happen if any step of a model's chain throws an error? "stop" (the default) lets the error propagate, halting targets::tar_make() as usual. "continue" catches an error from any of the model's steps – simplifying the object, reading its covariates, simplifying the data, or the estimation itself – and stores a failure sentinel (an object of class nlmixr2targetsError, which also inherits from "try-error") carrying the error message. The sentinel is passed down the model's remaining steps to its final target, so a single failed model does not stop the rest of the pipeline. Detect a failed model with inherits(fit, "nlmixr2targetsError") or the broader inherits(fit, "try-error").

description

Human-readable name for the model, announced by the estimation target when it starts to run. NULL (the default) announces nothing.

Value

An nlmixr2 fit object, as returned by nlmixr2est::nlmixr(). When error = "continue" and the estimation step fails, a failure sentinel of class nlmixr2targetsError (which also inherits from "try-error") is returned instead; see tar_nlmixr().

Details

object is the simplified nlmixrui returned by nlmixr_object_simplify() and held as the object_simple target in the pipeline. nlmixr_fit_simple() passes it to nlmixr2est::nlmixr() along with data, est, control, and – when the caller supplied one – table. An omitted table is passed on as omitted rather than as nlmixr2est::tableControl(), because nlmixr2est merges the table settings carried on ui$meta into the table control only when its own table argument is missing.