[R] "A critique of R and S-PLUS"

Jan T. Kim j.kim at uea.ac.uk
Thu Oct 30 12:24:23 CET 2008


On Thu, Oct 30, 2008 at 09:15:54AM +0100, Liviu Andronic wrote:
> Dear all,
> 
> The other day I stumbled on this article, "A critique of R and S-PLUS"
> [1], and got curious on whether the points outlined are (still) valid.
> The article is quite old, dating 2004, but was updated several times.
> 
> Regards,
> Liviu
> [1] http://fluff.info/blog/arch/00000041.htm

It's basically true that R notionally passes parameters by value, i.e.
functions cannot alter objects they're passed to them by their callers.

The critique that "this makes the language slow" is debatable, as the R's
"pass by promise" mechanism avoids much unnecessary copying. Personally,
I don't think that performance issues should be considered "first and
foremost", as the decision whether to use references should primarily
follow from the content i.e. the problem to be solved. There are
plenty of problems which require references, so not having a pass by
reference mechanism is a limitation.

In principle, it's possible to use environments in R for passing by
reference. The practical use of this is limited by the fact that the
majority of functions provided by standard packages don't operate on
environments, though.

Best regards, Jan
-- 
 +- Jan T. Kim -------------------------------------------------------+
 |             email: j.kim at .uea.ac.uk                                |
 |             WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*



More information about the R-help mailing list