views:

430

answers:

4

What are the differences between R and S?

+2  A: 

If you read past the first FAQ on answer the R FAQ holds some details on the specifics of the R implementation of S.

3.3 What are the differences between R and S?

Mark Nold
+7  A: 

The R FAQ does a decent job answering this question:

We can regard S as a language with three current implementations or “engines”, the “old S engine” (S version 3; S-Plus 3.x and 4.x), the “new S engine” (S version 4; S-Plus 5.x and above), and R. Given this understanding, asking for “the differences between R and S” really amounts to asking for the specifics of the R implementation of the S language, i.e., the difference between the R and S engines.

[...]

ars
A: 

If your talking about working from the command prompt or with scripts, the biggest difference will be package support. The most fundamental difference is the underscore assignment operator. In S y_2 is the same as y=2. In R y_2 is just a string/object. When I moved from S to R several years ago (was on S 5.x at the time) I found most of my functions and scripts ran pretty well by just replacing the underscores with <-. An example for me was the spatial stats implementation. At the time the S spatial stats package was about 8 years old with no updating. R had several packages available and most of the new research seemed to be implemented for R (free goes a long way with academics).

S-Plus has a huge GUI front-end and ostensibly that's what the several grand price tag is for. However my S experience is several versions old now.

kpierce8
A: 

If I'm not mistaken as of version 8 SPLUS is now compatible with R such that R libraries can be used in SPLUS.

Another difference is the scoping rules - R uses lexical scoping while S, as implemented by SPLUS, uses dynamic scope. This makes R more of a functional language but all objects reside in memory. In SPLUS if I recall correctly there is a 1:1 correspondence between objects in your workspace and objects on the hard-disk - this makes SPLUS slower but more amenable to handling larger data sets.

Stephen