update_saved_trials {adaptr}R Documentation

Update previously saved simulation results


This function updates a previously saved "trial_results" object created and saved by run_trials() using a previous version of adaptr, allowing the results from these previous simulations to be post-processed (including performance metric calculation, printing and plotting) without errors by this version of the package. The function should be run only once per saved simulation object and will issue a warning if the object is already up to date. And overview of the changes made according to the adaptr package version used to generate the original object is provided in Details.
NOTE: some values cannot be updated and will be set to NA (the posterior estimates from the 'final' analysis conducted after the last adaptive analysis and including outcome data for all patients), and thus using both raw_ests = TRUE and final_ests = TRUE in the extract_results() and summary() functions will lead to missing values for some of the values calculated for updated simulation objects.
NOTE: other objects created by the adaptr package, i.e., trial specifications generated by setup_trial() / setup_trial_binom() / setup_trial_norm() and single simulation results from run_trials() when not included in as part of the returned output from run_trials() should be re-created by re-running the relevant code using the updated version of adaptr; if manually re-loaded from previous sessions, they may cause errors and problems with the updated version of the package.


update_saved_trials(path, version = NULL, compress = TRUE)



single character; the path to the saved "trial_results"-object containing the simulations saved by run_trials().


passed to saveRDS() when saving the updated object, defaults to NULL (as in saveRDS()), which means that the current default version is used.


passed to saveRDS() when saving the updated object, defaults to TRUE (as in saveRDS()), see saveRDS() for other options.


The following changes are made according to the version of adaptr used to generate the original "trial_results" object:


Invisibly returns the updated "trial_results"-object.

See Also


[Package adaptr version 1.3.2 Index]