Back
Close

Computing with Data

elgeish
576.9K views

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:

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io