Read simulation results based on NMsim's track of model runs
Usage
NMreadSim(
x,
check.time = FALSE,
dir.sims,
wait = FALSE,
quiet = FALSE,
progress,
rm.tmp = FALSE,
as.fun
)
Arguments
- x
Path to the simulation-specific rds file generated by NMsim, typically called `NMsim_MetaData.rds`. Can also be a table of simulation runs as stored in `rds` files by `NMsim`. The latter should almost never be used.
- check.time
If found, check whether `fst` file modification time is newer than `rds` file. The `fst` is generated based on information in `rds`, but notice that some systems don't preserve the file modification times. Becasue of that, `check.time` is `FALSE` by default.
- dir.sims
By default, `NMreadSim` will use information about the relative path from the results table file (`_MetaData.rds`) to the Nonmem simulation results. If these paths have changed, or for other reasons this doesn't work, you can use the `dir.sims` argument to specify where to find the Nonmem simulation results. If an `.fst` file was already generated and is found next to the `_MetaData.rds`, the path to the Nonmem simulation results is not used.
- wait
If simulations seem to not be done yet, wait for them to finish? If not, an error will be thrown. If you choose to wait, the risk is results never come. `NMreadSim` will be waiting for an `lst` file. If Nonmem fails, it will normally generate an `lst` file. But if `NMTRAN` fails (checks of control stream prior to running Nonmem), the `lst` file is not generated. Default is not to wait.
- quiet
Turn off some messages about what is going on? Default is to report the messages.
- progress
Track progress? Default is `TRUE` if `quiet` is FALSE and more than one model is being read. The progress tracking is based on the number of models completed/read, not the status of the individual models.
- rm.tmp
If results are read successfully, remove temporary simulation results files? This can be useful after a script is developed and intermediate debugging information is not needed. It cleans up and saves significant disk space.
- as.fun
The default is to return data as a data.frame. Pass a function (say `tibble::as_tibble`) in as.fun to convert to something else. If data.tables are wanted, use as.fun="data.table". The default can be configured using NMdataConf.