Re: [R] An "R is slow"-article

From: Peter Dalgaard <>
Date: Wed, 09 Jan 2008 17:14:04 +0100

Gustaf Rydevik wrote:
> Hi all,
> Reading the wikipedia page on R, I stumbled across the following:
> It does seem interesting that the C execution is that much slower from
> R than from a native C program. Could any of the more technically
> knowledgeable people explain why this is so?
Well, if you are obsessed with speed, R can be the wrong tool. This is an ingrained aspect of the language itself; if you are interested, consult some of Luke Tierney's writings about the difficulties of writing an R compiler. To some extent, it is a tradeoff for flexibility and expressiveness.

The example is somewhat misleading. The C execution time is probably the same, but it is drowned out by the administrative overhead of fisher.test (a 2x2 Fisher test is really not a very complex operation when cell counts are in the hundreds.)

> The author also have some thought-provoking opinions on R being
> no-good and that you should write everything in C instead (mainly
> because R is slow and too good at graphics, encouraging data
> snooping). See
> While I don't agree (granted, I can't really write C), it was
> interesting to read something from a very different perspective than
> I'm used to.
The idea that you really shouldn't look at data before testing statistical hypotheses is not without merit, but taken to the extreme, it tends to become ridiculous. You end up in a situation where you either can't do anything or you don't know what you are doing. It is related to the discussions about randomized trials versus observational studies. The former are in many ways stronger, but sometimes unavailable, and they tend to be using a very big hammer to whack in a single nail.

   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 09 Jan 2008 - 16:17:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 09 Jan 2008 - 16:30:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive