[Rd] call R function from C code

Matwey V. Kornilov matwey.kornilov at gmail.com
Fri May 10 11:34:31 CEST 2013


Thanks, It is what I was looking for. But now, I poorly understand 
environment conception. My initial C function in invoked from R (in some 
environment I suppose), how do I know this env, to provide it to eval()? 
Or, may I just make a clean env?


10.05.2013 00:13, Gabriel Becker пишет:
> Matwey,
>
> There are a number of ways to do this, but it depends on what exactly you
> want. Do you want to execute a call to an actual R function from within C,
> or do you want to directly call one of R's internal C functions (which may
> work but is not future-safe unless it is part of the official API).
>
> If its the first, see Martin Morgan's post here:
> http://stackoverflow.com/questions/7457635/calling-r-function-from-c for
> more detail about the approach I believe Simon is referring to. As for the
> second, they are normal C functions, but I believe the consensus is that if
> they aren't part of the API you are on your own figuring out how they work
> (the source code is available for this of course).
>
> Hope that helps,
> ~G



More information about the R-devel mailing list