From rasmussen.bryan at gmail.com  Wed Aug  8 16:12:22 2007
From: rasmussen.bryan at gmail.com (bryan rasmussen)
Date: Wed, 8 Aug 2007 16:12:22 +0200
Subject: [Rd] SWF animation method
In-Reply-To: <FCD0D064-313C-4695-A706-4C4DCCFB06A8@DAL.CA>
References: <FCD0D064-313C-4695-A706-4C4DCCFB06A8@DAL.CA>
Message-ID: <3bb44c6e0708080712qfd8c387t3e78e8dfd442f5eb@mail.gmail.com>

I suppose what is really wanted is a way to associate a the parts of a
graph with a timeline a la gapminder.

Cheers,
Bryan Rasmussen

On 8/8/07, Mike Lawrence <Mike.Lawrence at dal.ca> wrote:
> Hi all,
>
> Just thought I'd share something I discovered last night. I was
> interested in creating animations consisting of a series of plots and
> after finding very little in the usual sources regarding animation in
> R directly, and disliking the imagemagick method described here
> (http://tolstoy.newcastle.edu.au/R/help/05/10/13297.html), I
> discovered that if one exports the plots to a multipage pdf, it is
> relatively trivial to then use the pdf2swf command in SWFTools
> (http://www.swftools.org/download.html; mac install instructions
> here: http://9mmedia.com/blog/?p=7).
>
> pdf2swf seems to generate swf animations with a slow frame rate, but
> you can increase the framerate using 'swfcombine -r 30 --dummy
> myslow.swf -o myfast.swf', where the value passed to -r is the
> framerate.
>
> Unfortunately, this method seems to have limitations with regards to
> the number of plots it can convert. For example, on my system (17"
> macbook pro, 2.33GHz, 2GB ram, OSX 10.4.10, R 2.5.1) the maximum
> number of single point plots I can do is about 5400 (i.e. for(i in
> 1:5400) plot(runif(1),ylim=c(0,1)) ). Complexity of the plots might
> matter as well, but I only have rather convoluted examples of this.
> Also, pdf2swf throws up a lot of errors ('ERROR   Internal error:
> drawChar.render!=beginString.render'), the origin of which I know
> not, that might be slowing things down.
>
> Now, if only someone could wrap this process into a single R command
> (I'm a little too newb to do this myself I think).
>
> Mike
>
> --
> Mike Lawrence
> Graduate Student, Department of Psychology, Dalhousie University
>
> Website: http://memetic.ca
>
> Public calendar: http://icalx.com/public/informavore/Public
>
> "The road to wisdom? Well, it's plain and simple to express:
> Err and err and err again, but less and less and less."
>         - Piet Hein
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] SWF animation method
bryan rasmussen