Skip to contents

This function is typically not needed by end users. It is the command of the _covariates target generated by tar_nlmixr(), whose value is what nlmixr_data_simplify() keeps beyond the standard event columns.

Usage

nlmixr_object_covariates(object, error = c("stop", "continue"))

Arguments

object

An nlmixr ui object (e.g. the output of running nlmixr(object = model)).

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").

Value

A sorted character vector of the covariate names and the occasion-level grouping variable names, possibly empty.

Details

Two kinds of column are read from the data by a model: its covariates, and the grouping variable of each occasion-level random effect. Both are returned, because both have to survive the data simplification: an occasion-level effect written eta ~ var | OCC leaves nlmixr2est stopping with IOV variable 'OCC' is not present in the data if OCC was dropped.

The names are de-duplicated and sorted in the C locale, so reordering the lines of a model, or running on a worker with a different locale, does not change the value and does not rebuild the simplified data.