6.2 Animation using gganimate

  • We can also use the gganimate package to convert the image into a gif.
  • Its also possible to create animations with plotly 6.4
library(gganimate)
p1.anim = p1 + transition_reveal(Date)
anim_p1 = animate(p1.anim, fps = 2, start_pause = 2, end_pause = 5, rewind = FALSE, 
    width = 800, height = 1000)
anim_save(filename = "covid_cases_log_2020jul.gif", animation = anim_p1)
Animated Graph

Figure 6.4: Animated Graph