
Chapter 6
Foreign Language Interfaces
6.1 Introduction
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, pro-
totyping in R is often cost effective. And in our experience very