Index of /examples/r/examples/call_c

Icon  Name                    Last modified      Size  Description
[DIR] Parent Directory - [   ] R_call_C.R 19-Nov-2017 12:31 109 [   ] c_lib.c 19-Nov-2017 12:32 682 [   ] c_lib.o 19-Nov-2017 12:32 7.5K [   ] 19-Nov-2017 12:32 9.7K

RCS Example of R script call C function

Compile C code:
[scc1 ~] R CMD SHLIB  c_lib.c -o

From R script load the dynamic library:
Execute C function :
result <- .Call("cfunction", a=21.7, b=3.14)

For help email

Research Computing Services:

Note: RCS example programs are provided "as is" without any warranty of any kind. The user assumes the intire risk of quality, performance, and repair of any defect. You are welcome to copy and modify any of the given examples for your own use.