Поскольку вы не предоставили воспроизводимый пример :
p <- ggplot(airquality, aes(Day, Temp)) +
geom_line(size = 2, colour = 'steelblue') +
transition_states(Month, 4, 1) +
shadow_mark(size = 1, colour = 'grey')
a <- animate(p, renderer = ffmpeg_renderer())
anim_save("animation.mp4", a)