Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Modern Interfaces to C Code

The .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 to use .Call to implement the same functionality as the .C example above. The type 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:

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content