The gganimate library is a ggplot2 extension that allows to easily create animation from your data. Basically it allows to provide a frame (the step in the animation) as another aesthetic.
Any customization offered by ggplot2 can be used in gganimate. Here is an illustration using small multiple.
Image Magick is a software that allows to work with images in command lines. You can create and output a set of images doing a loop in
R. Then, give all these images to Image magick and it will convert them into a