Create 10 files of jpg
frames <- 10 for(i in 1:frames) { jpeg(sprintf("ani_%02d.jpg", i)) plot(1:10, 1:10, col=i) dev.off() }
system("convert -delay 10 ani_??.jpg animation.gif")