views:

173

answers:

2

Hello,

I can't find it anywhere on the web (and I don't want to install it). Is the R language a compiled language? How fast does it run a pre-written script? Does it do any kind of compilation, or just execute instructions line by line?

+6  A: 

In most cases R is an interpreted language that runs in a read-evaluate-print loop. There are numerous extensions to R that are written in other languages like C and Fortran where speed or interfacing with native libraries is helpful.

Pridkett
+2  A: 

I've often rewritten R code in C++ and made it run 100x faster. Looping is especially inefficient in R.

John D. Cook
Taking advantage of matrix operations is important indeed. On the other hand, well designed R code can be blazingly fast. See this discussion: http://wiki.r-project.org/rwiki/doku.php?id=tips:programming:code_optim2
Eduardo Leoni