Skip to contents

Opens MVPapp with a scripted simulation already loaded, so you can carry on in the app: the model code and parameter values, OMEGA and SIGMA, dosing, sampling, the population settings and, optionally, observed data. A second simulation becomes the app's Model 2. mvp_save_session() writes the same as a session file for the app's "Load Session" button.

Usage

mvp_open_in_app(
  x,
  x2 = NULL,
  observed = NULL,
  target = NULL,
  target_time = NULL,
  background = FALSE,
  ...
)

mvp_save_session(
  x,
  file,
  x2 = NULL,
  observed = NULL,
  target = NULL,
  target_time = NULL
)

Arguments

x

A result of mvp_simulate() (Model 1).

x2

Optional second result (Model 2).

observed

Optional observed data, loaded as the app's dataset and overlaid on the simulation plots: mvp_observed() (its y and cmt), or a data frame.

target, target_time

Optional target value and time, shown in the app's threshold calculations (Variability page).

background

If TRUE, start the app in a separate R process and return at once (used by the MCP tools); if FALSE (default), run it in this session, like run_mvp().

...

Passed to run_mvp(), e.g. insert_watermark = FALSE.

file

Path of the session file (.rds) to write.

Value

mvp_save_session(): invisibly, file. mvp_open_in_app(): with background = TRUE, invisibly the app's address; otherwise runs the app.

Details

The app has 5 dosing regimens and 3 custom covariates per model; anything beyond that is left out, with a warning. Populations made with mvp_population() are sampled again by the app with the same settings and seed.

See also

Examples

# \donttest{
if (interactive()) {
  sim <- mvp_simulate(mvp_model("1cmt"), dose = mvp_dose(100, ii = 24, n = 7),
                      times = mvp_times(168))
  mvp_open_in_app(sim)
}
# }