- following on from my previous posts about animated maps, spatio-temporal animations and animations with buttons for go, stop and reverse
- Here is a quick note about how to do a simple animation with R to create a movie file (GIF)
- To create this movie
Code:animations-using-R
if(!require(animation)) install.packages("animation");
require(animation)
saveGIF(
{
ani.options(nmax = 100, interval = 0.5)
par(mar = c(3, 2.5, 0.5, 0.2), pch = 20, mgp = c(1.5, 0.5,0))
buffon.needle(mat = matrix(c(1, 2, 1, 3), 2))
},
outdir = getwd()
)