Publications by Radford Neal

Design Flaws in R #1 — Reversing Sequences

06.08.2008

The R language for statistical computing has become the standard for academic statistical research, for the very good reason that it’s better than the alternatives. It’s far from perfect however. I could come up with a long “wish list” of desired features it lacks, but that’s not what I’ll do in this series of posts. Instead, I’...

4743 sym R (591 sym/3 pcs) 20 img

Design Flaws in R #2 — Dropped Dimensions

19.08.2008

In a comment on my first post on design flaws in the R language, Longhai remarked that he has encountered problems as a result of R’s default behaviour of dropping a dimension of a matrix when you select only one row/column from that dimension. This was indeed the design flaw that I was going to get to next! I think it also points to what is...

4472 sym R (785 sym/7 pcs) 20 img

R Design Flaws #1 and #2: A Solution to Both?

25.08.2008

I’ve previously posted about two design flaws in R. The first post was about how R produces reversed sequences from a:b when a>b, with bad consequences in “for” statements (and elsewhere). The second post was about how R by default drops dimensions in expressions like M[i:j,] when i:j is a sequence only one long (ie, when i equals j). In b...

3911 sym R (541 sym/1 pcs) 8 img

Design Flaws in R #3 — Zero Subscripts

21.09.2008

Unlike the two design flaws I posted about before (here, here, and also here), where one could at least see a reason for the design decision, even if it was unwise, this design flaw is just  incomprehensible.  For no reason at all that I can see, R allows one to use zero as a subscript without triggering an error.  (Remember that in R, indexes...

3723 sym R (403 sym/3 pcs) 4 img

Two Surpising Things about R

14.08.2010

I see that it’s been over a year since my last post!  I have a backlog of blog post ideas, but something else always seems to have higher priority.   Today, though, I have some interesting (and useful) things to say about R, which I discovered in the last few days, and which shouldn’t take long to blog about.  Of course, some other people...

3689 sym R (616 sym/3 pcs) 4 img

Speeding up parentheses (and lots more) in R

19.08.2010

As I noted here, enclosing sub-expressions in parentheses is slower in R than enclosing them in curly brackets. I now know why, and I’ve modified R to reduce (but not eliminate) the slowness of parentheses. The modification speeds up many other operations in R as well, for an average speedup of something like 5% for programs that aren’t dom...

4808 sym R (798 sym/4 pcs) 4 img

Fourteen patches to speed up R

03.09.2010

Following my discovery of two surprising inefficiencies in R, I’ve been inspired to spend much of the last two weeks looking for ways to speed it up. I’ve had quite a bit of success, both at finding ways to speed up particular functions, and at finding ways to reduce general interpretive overhead. You can get my fourteen patches to the R sou...

1563 sym 4 img

Speed tests for R — and a look at the compiler

13.05.2011

I’ve gotten back to work on speeding up R, starting with improving my suite of speed tests.  Among other new features, this suite allows one to easily try out the “byte-code” compiler that is now a standard part of the latest release of R, version 2.13.0. You can get the suite here. I’ve been running these tests on my new workstation, wh...

4024 sym 4 img

Slowing down matrix multiplication in R

21.05.2011

After I realized that some aspects of R’s implementation are rather inefficient, one of the first things I looked at was matrix multiplication.  There I found a huge performance penalty for many matrix multiplies, a penalty which remains in the current version, 2.13.0.  As discussed below, eliminating this penalty speeds up long vector dot pr...

7185 sym 4 img 1 tbl

New patches to speed up R 2.13.0

09.06.2011

I have now released a new collection of 30 patches to speed up R version 2.13.0. You can get them here Assessing how much these patches speed up R is difficult. First of all, the speedup varies tremendously with the type of program. It also varies quite a bit with the machine and compiler used to run R. Finally, it varies in apparently random way...

4210 sym 4 img