Save plot to a file
export_plot.Rd
Save a plot of a stock-and-flow diagram or a simulation to a specified filepath.
See also
Other simulate:
ensemble()
,
julia_setup_ok()
,
plot.sdbuildR_ensemble()
,
plot.sdbuildR_sim()
,
sim_specs()
,
simulate()
,
solvers()
,
use_julia()
,
use_threads()
Examples
sfm = xmile("SIR")
filepath = tempfile(fileext = ".png")
export_plot(plot(sfm), filepath)
# Remove plot
file.remove(filepath)
#> [1] TRUE
if (FALSE) { # not_on_cran() & interactive()
sim = simulate(sfm)
export_plot(plot(sim), filepath)
# Remove plot
file.remove(filepath)
}