293 search results for "animation"

formatR: farewell to ugly R code

April 13, 2010
By
formatR: farewell to ugly R code

It is not uncommon to see messy R code which is almost not human-readable like this: # 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),cex=7*i/360) #

Read more »

Looking for Software Paths in Windows Registry

March 28, 2010
By
Looking for Software Paths in Windows Registry

hen we want to call external programs in R under Windows, we often need to know the paths of these programs. For instance, we may want to know where ImageMagick is installed, as we need the convert (convert.exe) utility to convert images to other formats, or where OpenBUGS is installed because we need this path

Read more »

Font Families for the R PDF Device

March 24, 2010
By

otivated by the excellent R package pgfSweave, I begin to notice the font families in my graphs when writing Sweave documents. The default font family for PDF graphs is Helvetica, which is, in most cases (I think), inconsistent with the LaTeX font styles. Some common font families are listed in ?postscript, and we can take

Read more »

R Tips in Stat 511

March 22, 2010
By
R Tips in Stat 511

Here are some (trivial) R tips in the course Stat 511. I’ll update this post till the semester is over. Formatting R Code Reading code is pain, but the well-formatted code might alleviate the pain a little bit. The function tidy.source() in the animation package can help us format our R code automatically. By default

Read more »

Press Enter in LyX Sweave as You Wish

February 18, 2010
By
Press Enter in LyX Sweave as You Wish

or a long time I’ve been wondering why we are not able to use Enter in the LyX Scrap environment which was set up by Gregor Gorjanc for Sweave. Two weeks ago, I (finally!) could not help asking Gregor about this issue, as I’m using “LyX + Sweave” more and more in my daily work.

Read more »

Happy New Year with R

December 31, 2009
By

I have to admit that the previous post on Christmas is actually not much fun. Today I received another pResent from Yixuan which is more interesting: Basically the code deals with letter polygons (i.e. glyphs) and plot them with proper projections from 3D to 2D space: ## original code by Yixuan <[email protected]>, with my slight modification h.x =

Read more »

Merry Christmas using R

December 25, 2009
By

Yihui creates an Christmas greeting using R: See the R code to create an animated message in Flash here: Keep on Fighting: Merry Christmas Using R

Read more »

Merry Christmas Using R

December 24, 2009
By

Life should be fun. I saw a post in R-help list saying Merry Christmas to other useRs, and I followed up by some R code which can produce a naive animation like this: Here is the code to generate the above Flash animation with shining Christmas: library(animation) saveSWF({ n = length(speed <- runif(angle <- runif(x

Read more »

Galton’s quincunx in R

December 13, 2009
By
Galton’s quincunx in R

Andrej Blejec has a very nice R demo of Galton's quincunx (link1, link2). It is a bit tedious to copy the code from PDF to R console, but it is worth the effort as the demo simulation clearly shows the nature of quincunx. After a bit of search I also f...

Read more »

Galton’s quincunx in R

December 13, 2009
By
Galton’s quincunx in R

Andrej Blejec has a very nice R demo of Galton's quincunx (link1, link2). It is a bit tedious to copy the code from PDF to R console, but it is worth the effort as the demo simulation clearly shows the nature of quincunx. After a bit of search I also f...

Read more »