[R] animation?

Matthew Nelson mnelson at esperion.com
Tue Mar 20 12:37:22 CET 2001


Bill,

It is quite easy to do with ImageMagick (www.imagemagick.org), which can be
installed on most OSes.  I tried this simple sequence and it worked
beautifully.

In R:

> for(i in 1:5) {
+ jpeg(paste("fig", i, ".jpg", sep = ""))
+ hist(rnorm(100))
+ dev.off()
+ }


Then from the command line (I tried it using Linux, though it should be the
same on any platform):

% convert -delay 50 -loop 50 fig*.jpg animated.gif

This created animated.gif, a nice animation of my sequence of files.  You
can control the timing of the animation by playing with -delay and -loop.

Regards,

Matt

Matthew R. Nelson, Ph.D.
Director, Information Systems
Esperion Therapeutics, Inc.
3621 S. State St.
695 KMS Place
Ann Arbor, MI 48108

Phone: (734) 222-1839  ** Note Change **
Mobile: (734) 657-6302
Fax: (734) 332-0516
email: mnelson at esperion.com
web: http://www.esperion.com


> -----Original Message-----
> From: Bill Simpson [mailto:wsi at gcal.ac.uk]
> Sent: Tuesday, March 20, 2001 4:43 AM
> 
> I was wondering if anyone out there has created a series of 
> images (e.g.
> jpegs) using R, then animated them on a web page. I have 
> looked around a
> bit and it seems fairly complicated. One approach that seems 
> sensible is
> to use a java script that displays the list of images. I have 
> only used
> html on web pages before so I don't know how to use java...
> Ideally the final result is easily ported to all OSes of web servers.
> 
> Thanks very much for any help.
> 
> Bill Simpson
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list