Skip to contents

This function is typically not needed by end users.

Usage

nlmixr_data_simplify(
  data,
  object,
  table = list(),
  directory = file.path(targets::tar_config_get("store"), "user/nlmixr2"),
  est = NULL,
  control = NULL
)

Arguments

data

nlmixr data

object

Either an nlmixr ui object (e.g. the output of running nlmixr(object = model)) or a character md5 hash identifying a simplified ui in the nlmixr2targets indirect cache (the form used in targets generated by tar_nlmixr()).

table

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

directory

Cache directory to load the simplified nlmixrui from. Defaults to file.path(targets::tar_config_get("store"), "user/nlmixr2"), mirroring the convention used by targets' own store = targets::tar_config_get("store") defaults — the path resolves at call time against whatever store the user has configured for the running tar_make() (e.g. a tempdir() location set via targets::tar_config_set()).

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

Value

The data with the nlmixr2 column lower case and on the left and the covariate columns on the right and alphabetically sorted.

Details

The standardization keeps columns that rxode2 and nlmixr2 use along with the covariates. Column order is standardized (rxode2 then nlmixr2 then alphabetically sorted covariates), and rxode2 and nlmixr2 column names are converted to lower case.

est and control only affect which columns are kept: with the default est = NULL, or any estimation method other than "vae", the standard and model covariate columns above are all that is kept. When est = "vae", the automated covariate selection searches subject-constant data columns beyond the covariates named in the model, so the candidate columns reported by nlmixr2est::vaeCovariates() (honoring the shapes, covCenterType, covCenter, and catCutoff settings in control) are kept as well. Columns the search cannot use (for example time-varying or partially-missing columns) are still dropped; the exclusion warnings that nlmixr2est::nlmixr() would raise for them are raised here instead, because the estimation step never sees the dropped columns.