gen.animation {cleanTS}R Documentation

Generate animation


This function takes the list outputted by animate_interval() and generates a GIF animation. It is a simple wrapper around the gganimate::animate() function with some defaults. The generated GIF can be saved using the anim_save() function. By default, in the animate() function only 50 states in the data are shown. So, to avoid this gen.animation() defines the default value for the number of frames. Also, the duration argument has a default value equal to the number of states, making the animation slower. More arguments can be passed, which are then passed to animate(), like, height, width, fps, renderer, etc.


gen.animation(anim, nframes = 2 * anim$nstates, duration = anim$nstate, ...)



List outputted by the animate_interval() function containing a gganim object and the number of states in the animation.


Number of frames. Defaults to double the number of states in the animation.


The duration of animation. Defaults to the number of states in the animation.


Extra arguments passed to gganimate::animate().


Does not return any value.


## Not run: 
a <- animate_interval(cts, "10 year")

# Generate animation using `gen.animation()`
gen.animation(a, height = 700, width = 900)

# Save animation using `anim_save()`

## End(Not run)

[Package cleanTS version 0.1.1 Index]