Blog Archives

alphahull: an R Package for Alpha-Convex Hull

April 16, 2010
By
alphahull: an R Package for Alpha-Convex Hull

new paper on the α-convex hull appeared in the Journal of Statistical Software today (http://www.jstatsoft.org/v34/i05/paper). The α-convex hull is an interesting problem which caught my attention long time ago but I didn’t know a solution then. R has a function chull() which can generate (indices of) the convex hull for a series of points. Now

Read more »

R is an Epic Fail?

April 15, 2010
By

I came across this blog post just now: The Next Big Thing, and of course these words caught my attention: However, for me personally and for most users, both individual and organizational, the much greater cost of software is the time it takes to install it, maintain it, learn it and document it. On

Read more »

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 »

Rules of Thumb to Meet R Gurus in the Help List

April 5, 2010
By

Here is my personal list of rules of thumb for people who want to meet some R gurus (quickly) in the R help mailing list ([email protected]): If you want to meet Dr Bill Venables, just say something about Type III Sum of Squares (better if you also mention the “unbeatable” SAS); If you want to

Read more »

Demonstrating the Power of F Test with gWidgets

April 2, 2010
By

e know the real distribution of the F statistic in linear models — it is a non-central F distribution. Under H0, we have a central F distribution. Given 1 – α, we can compute the probability of (correctly) rejecting H0. I created a simple demo to illustrate how the power changes as other parameters vary,

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 »

A Demo for the Ratio Estimation in Sampling Survey (Animation)

March 24, 2010
By
A Demo for the Ratio Estimation in Sampling Survey (Animation)

mber Watkins gave me a suggestion on the animation for the ratio estimation, and I think this is a good topic for my animation package. I’ve finished writing the initial version of the function sample.ratio() for this package, which will appear in the version 1.1-2 a couple of days later. As we know, the benefit

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 »

Guess the Random Seed

March 12, 2010
By

tephanie asked in 511 today if we were able to get the random seed which was set by set.seed() but we were only given the random numbers (without knowing the seed). This kind of “hacker” questions sound interesting. One dirty solution should be the brute-force method, e.g: # x: the random vector; # FUN: the

Read more »