[R] C-Code in R (running Windows)

Liaw, Andy andy_liaw at merck.com
Wed Mar 1 15:04:18 CET 2006

The simplest interface is to use .C() in R to call the C function.  The
details (with examples) are in the Writing R Extensions manual that comes
with every version of R.  To compile and load the .dll/.so into R, do:

- Type R CMD SHLIB file1.c file2.c  (at the command prompt, not the R
-...start up R in that directory
- Type dyn.load("file1")
- You can now use .C() to call the function


From: K.A.
> Hello,
> I need to include C (or C++)-Code in R. I'm searching for a 
> tutorial, how to
> do this. It is only a very small algorith (one function). 
> Using google, I
> read somethig about including dll-Files and so on (on windows). 
> Is there no possibility to include a C-File directly?!?
> --
> View this message in context: 
> http://www.nabble.com/C-Code-in-R-%28running-Windows%29-t12051
Sent from the R help forum at Nabble.com.

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide!

More information about the R-help mailing list