In formatR 0.1-5, the dependency on the gWidgets and animation
packages are removed. The GUI by gWidgets is optional now.

Meanwhile, the function tidy.source() has been moved from the
animation package to this package.

> library(formatR)
> tidy.source(textConnection('
  # rotation of the word "Animation"
  # in a loop; change the angle and color
  # step by step
  for (i in 1:360) {
  # redraw the plot again and again
  plot(1,ann=FALSE,type="n",axes=FALSE)
  # rotate; use rainbow() colors
  text(1,1,"Animation",srt=i,col=rainbow(360)[i],cex=7*i/360)
   # pause for a while
   Sys.sleep(0.01)}
'))

# rotation of the word 'Animation'
# in a loop; change the angle and color
# step by step
for (i in 1:360) {
    # redraw the plot again and again
    plot(1, ann = FALSE, type = "n", axes = FALSE)
    # rotate; use rainbow() colors
    text(1, 1, "Animation", srt = i, col = rainbow(360)[i], cex = 7 * i/360)
    # pause for a while
    Sys.sleep(0.01)
}

For more information, see http://yihui.name/en/2010/12/formatr-update-0-1-5/

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA

_______________________________________________
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to