anim_save: Save an animation to a file

View source: R/anim_save.R

anim_saveR Documentation

Save an animation to a file

Description

This function is analogous to ggplot2::ggsave() in that it by default takes the last created animation and saves it to the specific location. As gganimate supports arbitrary renderers, and thus return types, the returned object must implement a save_animation method to be able to be used with anim_save(). This is provided natively for gif_image and magick-image objects.

Usage

anim_save(filename, animation = last_animation(), path = NULL, ...)

Arguments

filename

File name to create on disk.

animation

The animation object to save, as returned by animate(). Defaults to the last rendered animation using last_animation()

path

Path of the directory to save plot to: path and filename are combined to create the fully qualified file name. Defaults to the working directory.

...

arguments passed on to animate() if animation is a gganim object


thomasp85/gganimate documentation built on Feb. 29, 2024, 11:16 p.m.