Re: [R] HOW to Create Movies with R with repeated plot()?

From: Ted Harding <>
Date: Thu 28 Jul 2005 - 01:44:36 EST

On 27-Jul-05 Jan Verbesselt wrote:
> Dear R-helpers,
> Is it possible to create a type of 'movie' in R based on the
> output of several figures (e.g., jpegs) via the plot() function.
> I obtained dynamic results with the plotting function and would
> like to save these as a movie (e.g., avi or other formats)?

A similar question was discussed on R-help some months ago: Start at

  Cari G Kaufman <>,
  "[R] animation without intermediate files?"   Thu, 6 Jan 2005 16:21:36 -0500 (EST)

However, this is not quite your question! It seems you would be content with making a movie out of files already saved from R, so it's not a "real-time" situation.

There are several approaches you could adopt.

One (if you are using Linux with ImageMagick installed -- or if this is available for your platform if different) is to use the program 'animate' in that suite of programs.

The format of the image files does not matter for 'animate' (though I think all should have the same format), so they could be .jpg, .gif, etc. Suppose you had a set of files


then the command

  animate graph*.jpg

would present them as an animation in due order. There are several options to the 'animate' command which you can use to control features of how they are displayed. One you would probably want to use is "-delay" -- e.g.

  animate -delay 7 graph*.jpg

would pause for 7/100 seconds between successive images.

Another option is to create an "animated GIF" -- a single file which encapsulates several images and displays them in sequence when the file is opened with suitable software (most Web browsers do this well; likewise so does ImageMagick's 'display').

Programs which can create animated GIFs include the GIMP and gifsicle in the Free Software world. There are also several programs for non-Linux platforms.

Sorry I can't help with suggestions for creating .avi files.

Best wishes,

E-Mail: (Ted Harding) <> Fax-to-email: +44 (0)870 094 0861
Date: 27-Jul-05                                       Time: 14:08:00
------------------------------ XFMail ------------------------------

______________________________________________ mailing list PLEASE do read the posting guide! Received on Thu Jul 28 01:54:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:05 EST