In order for gganimate to work, you need to have a renderer installed in your system, the default is gifsky but you can change it with the renderer parameter animate(plot, renderer = ffmpeg_renderer()), although, I don't know which renderers are available on shinyapps.io
shinyapps.io does not automatically install packages listed under Suggests, so if you want to use gifski, you should include a library(gifski) line in your code.