
188 R Programming for Bioinformatics
6.3 Writing C code to interface with R
The command R CMD SHLIB can be used to create a shared library suitable
for loading into R from a collection of C or FORTRAN program files. When
including source code in an R package, the recommended method is to place
all code in a subdirectory named src, and then the appropriate shared library
will be constructed when the package is installed.
6.3.1 Registering routines
One of the most important new developments in R is the ability to register
foreign routines. Registration provides a mechanism to help ensure that the
correct code is evaluated, and it also provides mechanisms ...