From matwey.kornilov at gmail.com  Fri May 10 11:34:31 2013
From: matwey.kornilov at gmail.com (Matwey V. Kornilov)
Date: Fri, 10 May 2013 13:34:31 +0400
Subject: [Rd] call R function from C code
In-Reply-To: <CADwqtCNZrAsF+j5NCqiAnqz7Go4eGSE5ctw0Hb0nYOjP6vswdA@mail.gmail.com>
References: <kme57t$sca$1@ger.gmane.org>
	<2DC85D00-8F28-4EFA-BBE7-D5488B1DC894@r-project.org>
	<CADwqtCNZrAsF+j5NCqiAnqz7Go4eGSE5ctw0Hb0nYOjP6vswdA@mail.gmail.com>
Message-ID: <kmiev2$qj2$1@ger.gmane.org>


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



[Rd] call R function from C code
Matwey V. Kornilov