Open Source Your Knowledge, Become a Contributor

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

Create Content

Interfacing with C Code

For example, consider the task of computing some function given two vectors a and b of size n. The C code to compute the result appears below (fooC.c); note the presence of the pre-processor directive include <R.h>. You may execute code from fooC.R after running the command R CMD SHLIB fooC.c; the runnable example below runs that command for you:

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