Tuesday, 18 August 2009

Have you ever heard about the 'animation package'?

Well, I had never heard about it, but this morning I was looking for some information about another package and I found and article about this interesting package at 'The R-Journal' (http://journal.r-project.org/), it was on the Vol. 8/2, October 2008, by Yihui Xie and Xiaoyue Cheng, and it says something like...


"The animation package (Xie, 2008) uses graphical and
other animations to communicate the results of statistical
simulations, giving meaning to abstract statistical theory."


Awesome!, isn't it?. The basic idea of an animation, consists of multiple image frames, which can be designed to correspond to the successive steps of an algorithm or of a data analysis.

The basic schema for all animation functions in the package is:


ani.fun <- function(args.for.stat.method,args.for.graphics, ...) {
{stat.calculation.for.preparation.here}
i = 1
while (i <= ani.options("nmax") &other.conditions.for.stat.method) {
{stat.calculation.for.animation}
{plot.results.in.ith.step}
# pause for a while in this step
Sys.sleep(ani.options("interval"))
i = i + 1
}
# (i - 1) frames produced in the loop
ani.options("nmax") = i - 1
{return.something}
}

I will leave this post here while I find the way to upload the animations in here, hope not to delay too much in that.

Have a nice day ;)

No comments:

Post a Comment