ABSTRACT

In this chapter we discuss some of the many different interfaces to functions and libraries written in other languages. There are several reasons for wanting to interact with software written in other languages. The two main reasons are efficiency and access to existing code bases. Since R is not compiled, in some situations its performance can be substantially improved by writing code in a compiled language. There are also reasons not to write code in other languages, and in particular we caution against premature optimization, prototyping in R is often cost effective. And in our experience very few routines need to be implemented in other languages for efficiency reasons. Another substantial reason not to use an implementation in some other language is increased complexity. The use of another language almost always results in higher maintenance costs and less stability. In addition, any extensions or enhancements of the code will require someone that is proficient in both R and the other language.