[R] [R-pkgs] formatR update (0.1-5)

Yihui Xie xie at yihui.name
Fri Dec 3 16:11:02 CET 2010


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 <xieyihui at 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-packages at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages



More information about the R-help mailing list