Summary: This paper reviews some programming techniques in R that have proved useful, particularly for substantial projects. These include several versions of object-oriented programming, used in a large number of R packages. The review tries to clarify the origins and ideas behind the various versions, each of which is valuable in the appropriate context.

R has also been strongly influenced by the ideas of functional programming and, in particular, by the desire to combine functional with object oriented programming.

To clarify how this particular mix of ideas has turned out in the current R language and supporting software, the paper will first review the basic ideas behind object-oriented and functional programming, and then examine the evolution of R with these ideas providing context.

Functional programming supports well-defined, defensible software giving reproducible results. Object-oriented programming is the mechanism par excellence for managing complexity while keeping things simple for the user. The two paradigms have been valuable in supporting major software for fitting models to data and numerous other statistical applications.

The paradigms have been adopted, and adapted, distinctively in R. Functional programming motivates much of R but R does not enforce the paradigm. Object-oriented programming from a functional perspective differs from that used in non-functional languages, a distinction that needs to be emphasized to avoid confusion.

R initially replicated the S language from Bell Labs, which in turn was strongly influenced by earlier program libraries. At each stage, new ideas have been added, but the previous software continues to show its influence in the design as well. Outlining the evolution will further clarify why we currently have this somewhat unusual combination of ideas.

R has also been strongly influenced by the ideas of functional programming and, in particular, by the desire to combine functional with object oriented programming.

To clarify how this particular mix of ideas has turned out in the current R language and supporting software, the paper will first review the basic ideas behind object-oriented and functional programming, and then examine the evolution of R with these ideas providing context.

Functional programming supports well-defined, defensible software giving reproducible results. Object-oriented programming is the mechanism par excellence for managing complexity while keeping things simple for the user. The two paradigms have been valuable in supporting major software for fitting models to data and numerous other statistical applications.

The paradigms have been adopted, and adapted, distinctively in R. Functional programming motivates much of R but R does not enforce the paradigm. Object-oriented programming from a functional perspective differs from that used in non-functional languages, a distinction that needs to be emphasized to avoid confusion.

R initially replicated the S language from Bell Labs, which in turn was strongly influenced by earlier program libraries. At each stage, new ideas have been added, but the previous software continues to show its influence in the design as well. Outlining the evolution will further clarify why we currently have this somewhat unusual combination of ideas.

##### MSC:

62-04 | Software, source code, etc. for problems pertaining to statistics |

##### References:

[1] | Becker, R. A. and Chambers, J. M. (1977). Gr-z: A system of graphical subroutines for data analysis. In Proc. Interface Symp. on Statistics and Computing 10 409-415. |

[2] | Becker, R. A. and Chambers, J. M. (1984). S : An Interactive Environment for Data Analysis and Graphics . Wadsworth, Belmont, CA. |

[3] | Becker, R. A. and Chambers, J. M. (1985). Extending the S System . Wadsworth, Belmont, CA. |

[4] | Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988). The New S Language . Chapman & Hall, Boca Raton, FL. · Zbl 0642.68003 |

[5] | Chambers, J. M. (1977). Computational Methods for Data Analysis . Wiley, New York. · Zbl 0463.68001 |

[6] | Chambers, J. M. (1987). Interface for a quantitative programming environment. In Comp. Sci. and Stat. , Proc. 19 th Symp. on the Interface 280-286. |

[7] | Chambers, J. M. (1998). Programming with Data : A Guide to the S Language . Springer, New York. · Zbl 0902.68022 |

[8] | Chambers, J. M. (2008). Software for Data Analysis : Programming with R . Springer, New York. · Zbl 1180.62002 |

[9] | Chambers, J. M. and Hastie, T., eds. (1992). Statistical Models in S . Chapman & Hall, Boca Raton, FL. · Zbl 0776.62007 |

[10] | Chambers, J. M., Mallows, C. L. and Stuck, B. W. (1976). A method for simulating stable random variables. J. Amer. Statist. Assoc. 71 340-344. · Zbl 0341.65003 · doi:10.2307/2285309 |

[11] | Danenberg, P. (2011). rJavax: rJava extensions. R package version 0.3. Available at . · CRAN.R-project.org |

[12] | Eddelbuettel, D. and FranĂ§ois, R. (2011). Rcpp: Seamless R and C++ integration. Journal of Statistical Software 40 1-18. |

[13] | Gentleman, R. C., Carey, V. J., Bates, D. M. et al. (2004). Bioconductor: Open software development for computational biology and bioinformatics. Genome Biology 5 R80. |

[14] | Grothendieck, G. and Bellosta, C. J. G. (2012). rJython: R interface to Python via Jython. R package version 0.0-4. Available at . · CRAN.R-project.org |

[15] | Ihaka, R. and Gentleman, R. (1996). R: A language for data analysis and graphics. J. Comput. Graph. Statist. 5 299-314. |

[16] | Odersky, M., Spoon, L. and Venners, B. (2010). Programming in Scala , 2nd ed. Artima, Walnut Creek, CA. |

[17] | Python (2013). The Python Tutorial. Python. Available at . · docs.python.org |

[18] | R Core Team (2013). R Language Definition . R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-13-5. Available at . · cran.r-project.org |

[19] | Shalit, A. (1996). The Dylan Reference Manual . Addison-Wesley, Reading, MA. · Zbl 0900.68121 |

[20] | Temple Lang, D. (2014). Enhancing R with advanced compilation tools and methods. Statist. Sci. 29 181-200. · Zbl 1333.68081 · doi:10.1214/13-STS462 · euclid:ss/1408368570 |

[21] | Tierney, L. (1990). LISP-STAT : An Object-Oriented Environment for Statistical Computing and Dynamic Graphics . Wiley, New York. · Zbl 0747.62007 |

This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.