Functions to pass R objects to compiled C/C++ code that has been loaded into R.
.Call(.NAME, …, PACKAGE) .External(.NAME, …, PACKAGE)
arguments to be passed to the compiled code. Up to 65 for
if supplied, confine the search for a character string
.NAME to the DLL given by this argument (plus the
This argument follows
... and so its name cannot be abbreviated.
This is intended to add safety for packages, which can ensure by using this argument that no other package can override their external symbols, and also speeds up the search (see ‘Note’).
An R object constructed in the compiled code.
Writing code for use with these functions will need to use internal R
structures defined in
Rinternals.h and/or the macros in
The functions are used to call compiled code which makes use of internal R objects, passing the arguments to the code as a sequence of R objects. They assume C calling conventions, so can usually also be used for C++ code.
For details about how to write code to use with these functions see
the chapter on ‘System and foreign language interfaces’ in
the ‘Writing R Extensions’ manual. They differ in the way the
arguments are passed to the C code:
.External allows for a
variable or unlimited number of arguments.
These functions are primitive, and
.NAME is always
matched to the first argument supplied (which should not be named).
For clarity, avoid using names in the arguments passed to
that match or partially match
Chambers, J. M. (1998)
Programming with Data. A Guide to the S Language.
The ‘Writing R Extensions’ manual.