Writes the app's reproducible bundle (".zip": the model code, a standalone
simulation.R script, the dosing events and, for a population, the
covariates) for a simulation from mvp_simulate(). Give several
simulations (e.g. two regimens or two models that were compared) to get one
bundle for all of them: a folder per simulation with its own standalone
bundle, a compare.R script that runs them and redraws the comparison
(profiles, exposure table, percentage above a target), and a README that
says how the simulations differ.
Arguments
- x
An
mvp_simobject frommvp_simulate(), or a named list of them (as formvp_compare(); unnamed ones become "Model 1", "Model 2", ...).- file
Path of the
.zipfile to write (required; nothing is written by default).- var, start, end, target, at
Several simulations only: the comparison that
compare.Rredraws: the output (default: the first output), the exposure window (default: the whole simulation), a target value and the times at which to count subjects above it (default: the last sampling time).
Examples
# \donttest{
if (interactive()) {
mod <- mvp_model("1cmt")
sim <- mvp_simulate(mod, dose = mvp_dose(100), times = mvp_times(24))
mvp_bundle(sim, file.path(tempdir(), "scenario.zip"))
qd <- mvp_simulate(mod, dose = mvp_dose(200, ii = 24, n = 7), times = mvp_times(168),
population = 50)
bid <- mvp_simulate(mod, dose = mvp_dose(100, ii = 12, n = 14), times = mvp_times(168),
population = 50)
mvp_bundle(list("200 mg QD" = qd, "100 mg BID" = bid), file.path(tempdir(), "comparison.zip"),
start = 144, end = 168, target = 0.5)
}
# }