posted
1/29/2006

movies or animations with R

Learned from http://tolstoy.newcastle.edu.au/~rking/R/help/05/07/9319.html">this thread in the R Help Archive. This is actually not an issue for R at all---R just saves a series of images, which is regular work.

  1. Save a series of images in EPS, PNG, or JPEG formats.
  2. Use convert -delay xxx ... xxx.gif or convert -delay xxx... xxx.mpg to bundle them into an animated GIF image or a MPEG video. While creating animated GIFs with EPS images, use the -page letter option for convert. The utility convert is part of ImageMagick. Creating MPEG requires mpeg2encode in your system. This is freeware that can be downloaded.
  3. View the result. This is a non-issue on Windows and Mac. On Linux, view animated GIFs with animate, again part of ImageMagick. Play MPEGs with animate (I didn't get it work) or xine (I don't have it), or RealPlayter.

There's also a program called jpegtoavi. I failed to compile it. It is only a viable option if the resultant AVI file is smaller than MPEG, but I doubt it.