Animate the simulated population dynamics

animate(
  model,
  output_dir = model$path,
  output_prefix = "output",
  steps,
  gif = NULL,
  width = 800,
  height = 560
)

Arguments

model

Compiled slendr_model model object

output_dir

A directory where to look for simulation outputs (by default, all output files are in a model directory)

output_prefix

A common prefix of output files (by default, all files will share a prefix "output")

steps

How many frames should the animation have?

gif

Path to an output GIF file (animation object returned by default)

Value

If gif = NULL, return gganimate animation object. Otherwise a GIF file is saved and no value is returned.