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,
directory = file.path(targets::tar_config_get("store"), "user/nlmixr2"),
error = c("stop", "continue")
)Arguments
- object
Either an
nlmixrui object (e.g. the output of runningnlmixr(object = model)) or a character md5 hash identifying a simplified ui in thenlmixr2targetsindirect cache (the form used in targets generated bytar_nlmixr()).- directory
Cache directory to load the simplified
nlmixruifrom. Defaults tofile.path(targets::tar_config_get("store"), "user/nlmixr2"), mirroring the convention used bytargets' ownstore = targets::tar_config_get("store")defaults — the path resolves at call time against whatever store the user has configured for the runningtar_make()(e.g. atempdir()location set viatargets::tar_config_set()).- error
What should happen if any step of a model's chain throws an error?
"stop"(the default) lets the error propagate, haltingtargets::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 classnlmixr2targetsError, 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 withinherits(fit, "nlmixr2targetsError")or the broaderinherits(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.
See also
Other Simplifiers:
nlmixr_data_simplify(),
nlmixr_object_complicate(),
nlmixr_object_simplify()