saveParams() saves a MizerParams object to a file. This can then be
restored with readParams(). saveSim() and readSim() provide the same
lifecycle for MizerSim objects.
Usage
saveParams(params, file)
readParams(file, install_extensions = FALSE)
saveSim(sim, file)
readSim(file, install_extensions = FALSE)Value
saveParams() and saveSim() return NULL invisibly.
readParams() returns a MizerParams object. readSim() returns a MizerSim
object.
Details
Issues a warning if the model you are saving relies on some custom functions.
Before saving a model you may want to set its metadata with
setMetadata().
See also
"Using mizer extension packages":
vignette("using-extension-packages", package = "mizer")
Examples
# Save params to a temporary file and read them back
tmp <- tempfile(fileext = ".rds")
saveParams(NS_params, file = tmp)
params <- readParams(tmp)
identical(params, NS_params)
#> [1] TRUE
# Save and read back a simulation
tmp2 <- tempfile(fileext = ".rds")
saveSim(NS_sim, file = tmp2)
sim <- readSim(tmp2)
identical(sim, NS_sim)
#> [1] TRUE
