Arr Language

R Language (Arr Language) is a Functional Programming language which has some relationship to Scheme Language. It is described as an open source version of the S language (Ess Language).

By the title, I thought it targeted pirates. It doesn't have Garbage Collection, rather it makes the bits walk the plank.

It is particularly developed as a set of Powerful Ad Hoc Data Processing Tools for use by statisticians, and currently appears to be the lingua franca for academics researching statistical methods. Consequently there are many extensions available for statistical calculations. There is an extraordinary plotting library 'ggplot2' inspired by the The Grammar Of Graphics.

The "weirdest" characteristic of R is its that it uses a Call By Need evaluation scheme, despite not being a Single Assignment Language. Function arguments are not evaluated until referenced in the body of a function. You usually don't notice, but sometimes you do. For example:

makeAddarr <- function(addWhat) { function (x) x + addWhat } addarrs <- list(makeAddarr(1), makeAddarr(2), makeAddarr(3)) for (a in addarrs) print(a(10))

prints 11, 12 and 13 as you might expect, but

for (i in 1:3) { addarrsi <- makeAddarr(i) } for (a in addarrs) print(a(10))

prints 13, 13, and 13! The reason is that, for each adder, the value of addWhat is not computed until referenced in the inner function -- by which time "i" has already changed.

The Call By Need system is also exploited in writing things that act like Runtime Macros.

Much information is available at the Comprehensive Arr Archive Network (CRAN) - see cran.r-project.org

There is also background on wikipedia at en.wikipedia.org

It contains Sweave (Ess Weave) a Literate Programming tool to combine R code with report documents.

Simplified Wrapper And Interface Generator (SWIG) can be used to make calls to Cee Language or Cee Plus Plus code.

There is also Arr Py (RPy) to make links between R and Python Language.


Book: R in a Nutshell (Arr Ina Nutshell) (Oreilly And Associates) explains some of the things which need explaining. -- John Fletcher

Patrick Burns wrote "The R Inferno" which explains R from the pessimistic perspective of walking through all the pitfalls. www.burns-stat.com


See original on c2.com