Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Modern Interfaces to C Code
.Call function offers a higher degree of flexibility than
.C in terms
of passing and returning R arrays or dataframes. The example below shows how
.Call to implement the same functionality as the
.C example above.
SEXP represents an R object. The
REAL macro returns a pointer
to the corresponding memory for reading or writing to it. Here's an example: