Up-to-Date Guidance from One of the Foremost Members of the R Core Team
Written by John M. Chambers, the leading developer of the original S software, Extending R covers key concepts and techniques in R to support analysis and research projects. It presents the core ideas of R, provides programming guidance for projects of all scales, and introduces new, valuable techniques that extend R.
The book first describes the fundamental characteristics and background of R, giving readers a foundation for the remainder of the text. It next discusses topics relevant to programming with R, including the apparatus that supports extensions. The book then extends R’s data structures through object-oriented programming, which is the key technique for coping with complexity. The book also incorporates a new structure for interfaces applicable to a variety of languages.
A reflection of what R is today, this guide explains how to design and organize extensions to R by correctly using objects, functions, and interfaces. It enables current and future users to add their own contributions and packages to R.
A 2017 Choice Outstanding Academic Title
Table of Contents
Objects, Functions and Interfaces
Everything is an Object
Everything is a Function Call
Interfaces are Part of R
The First Version of S
Functional, Object-Based S
R Arrives and Evolves
Evolution of Object-Oriented Programming
Functional OOP in S and R
S4 and R
R in Operation
Objects and References
The R Evaluator
Programming with R
Small, Medium and Large
Functional Programming and R
Assignments and Replacements
Computing on the Language
Interfaces and Primitives
Getting it to Run Faster
Types and Attributes
Reference Objects; Environments
Installing a Package
Loading and Attaching a Package
Sharing your Package
In the Large
Classes and Methods in R
OOP Software in R
Functional and Encapsulated OOP
Creating Classes in R
Creating Methods in R
Example: Classes for Models
Functional OOP in R
Functional OOP in Extending R
Defining Methods and Generic Functions
Classes and Methods in an R Package
Functional Classes in Detail
Generic Functions in Detail
Functional Methods in Detail
S3 Methods and Classes
Encapsulated OOP in R
The Structure of Encapsulated OOP
Using Encapsulated OOP
Defining Reference Classes
Fields in Reference Classes
Methods in Reference Classes
Functional Methods for Reference Classes
Subroutines and Evaluators
Server Language Software
Server Language Computations
Server Language Object References
Interfaces for Performance
The XR Structure for Interfaces
The XR Interface Structure
Evaluator Objects and Methods
Specializing to the Server Language
Proxy Functions and Classes
An Interface to Python
R and Python
An Interface to Julia
R and Julia
R, Subroutines and C++
C++ Interface Programming
John M. Chambers is a consulting professor in the Department of Statistics at Stanford University. He previously worked at Bell Labs for 40 years, where he contributed to major research and management in statistical computing and related fields. He was the first statistician to be named a Bell Labs Fellow.
Chambers is best known for the creation and extension of the S software, the predecessor to today’s very popular R. He has continued to contribute essential new directions to R. In 1999, he was honored with the ACM Software System Award, which noted that "S has forever altered the way people analyze, visualize, and manipulate data."
He is a board member of the R Foundation and the R Consortium; a fellow of the ASA, the IMS, and the AAAS; and an elected member of the ISI. He is the author or co-author of nine books, including the first comprehensive book on computational methods for statistics.
"Chambers, a consulting professor in the Department of Statistics at Stanford University, indicates that the purpose of this book is to encourage and help individuals develop extensions to the R software. Obviously, one must have experience using R and ideas for extensions that he or she would like to make, such as adding some functions or developing packages of different degrees of sophistication. The book contains three fundamental principles: every element that exists within R is an 'object,' all elements that happen within R are a 'function' call, and 'interfaces' to other software are part of R. These principles are then expanded in sections about ideas and history, aspects of programming in R, object-oriented programming, and interfaces from R to other software. As Chambers is the creator of the S software (the predecessor of R), any of his works are considered important and should be acquired by all statistical science libraries. This book will be a valuable guide for individuals who wish to develop their own extensions to R, whether at a modest or a more ambitious level.
Summing Up: Highly recommended. Lower-division undergraduates and above; faculty and professionals."
~R. Bharath, Northern Michigan University
". . . Chambers provides valuable insight into some of the thinking that led to major contributions to R’s development. For example, one section is divided thoughtfully into three themes, namely, programming in the small, in the medium, and in the large. Each theme is used to introduce and illustrate different aspects of the language, from the point of view of the kinds of activities that cluster within the themes, and here the book really shines. It is a pleasure to see how a crafter of tools thinks deeply about how the tool will be used."
~Andrew Robinson, University of Melbourne
"Doug Bates once said to me that 'There’s no doubt about John Chambers. He can see much further than the rest of us.' This latest book is yet another illustration of that incisive observation. It is fundamentally a book about perspectives and strategies. It gives a deep insight into the R landscape, its background and structure, and shows how users can work with R when they need to extend its facilities."
~Biometrics, June 2017
"This book is a must-have for anyone with a deep interest in statistical computing . . . you will learn some of the theory that underpins R, and see the directions in which you can extend it to solve your problems . . . it does give you powerful ways of thinking about programming on a large scale that will pay off as you tackle more ambitious projects."~Hadley Wickham, Journal of the American Statistical Association
" . . . any new book by John Chambers, the main developer of the original S language from which R derives, commands particular attention. . . Experienced R programmers will want a copy. R users seeking a deeper understanding of the internal structure of the language will also benefit, especially regarding aspects of functional programming and object-oriented computations.
~Christian Kleiber, Stat Papers