parkerabercrombie / call-r-from-c

Small example of how to call into R code from C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

call-r-from-c

Author: Parker Abercrombie

Small example of how to call into R code from C. This example creates an array in C, calls a function in R that adds one to each element of the array, and then prints the results from C.

To compile and run the example:


  make
  ./r_test.sh

Note that you may need to adjust the path to the R header and library files in Makefile and r_test.sh to suit your system.

The R function is defined in func.R, and code to call this function from C is in r_test.c.

About

Small example of how to call into R code from C.

License:Apache License 2.0


Languages

Language:C 65.8%Language:Makefile 16.3%Language:Shell 12.7%Language:R 5.2%