Animate a plinko_board() object. Follows the syntax for gganimate::animate() with a few exceptions/additions noted below.

# S3 method for plinko_board
animate(
  plot,
  fps = 10,
  renderer = gganimate::gifski_renderer(),
  device = ragg::agg_png,
  start_pause = 0,
  end_pause = 0,
  width = NULL,
  height = 800,
  res = 100,
  progress = interactive(),
  show_paths = FALSE,
  show_dist = FALSE,
  show_target_dist = FALSE,
  cores = getOption("cores", 1),
  ...
)

Arguments

plot

A plinko_board() object

fps

The framerate of the animation in frames/sec (default 10).

renderer

The function used to render the generated frames into an animation. Gets a vector of paths to images along with the framerate. (default gganimate::gifski_renderer())

device

A device function used to render images. Default ragg::agg_png is faster and produces higher-quality output than the base png function.

start_pause, end_pause

Number of times to repeat the first and last frame in the animation (default is 0 for both)

width, height

One of either width or height must be provided. The other dimension is automatically determined based on the aspect ratio of the Plinko board.

res

The resolution of the device. This setting will govern how device dimensions given in inches, centimeters, or millimeters will be converted to pixels. Further, it will be used to scale text sizes and linewidths

progress

Output progress bar and messages? Default is to only output during interactive sessions.

show_paths

Should ball paths be shown?

show_dist

Should an overlay of the binomial distribution for this Plinko board be shown?

show_target_dist

For plinko_board() objects constructed from a distributional object (like dist_normal(), etc), should an overlay of the target distribution for this Plinko board be shown?

cores

(experimental) How many cores to use to render animation frames.

...

Arguments passed on to the device. See ragg::agg_png for the arguments for the default device. For available device arguments to other devices, see the corresponding documentation (e.g. grDevices::png()).