There are different formats that animations can be created in R which include GIF, HTML, LaTeX, SWF and mp4. The code below shows the basic format for each of the calls: saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
}) This code creates an animation by generating and then…