chapter  16
16 Pages

Subroutine Interfaces; An Interface to C++

ByJohn M. Chambers

The programming for the application should be convenient and general as well. Two of the main tools for the XR structure would be equally relevant for subroutine interfaces: functions and classes in R that are proxies for those in the server language. The interface to C++ provided by the Rcpp package can be helpful in extending R in several scenarios, requiring a varying amount of actual C++ programming. The C++ library provides useful subroutine interfaces for communicating with JavaScript. Data conversion in Rcpp differs from that in the XR interfaces in that it is essentially all programmed in the server language. Proxy functions are a powerful mechanism for interface programming: a function is called in R that is in effect a call to a corresponding function in the server language. C++ started out as "C with classes" and its encapsulated object-oriented programming nature is central to many applications using the language.