On Fri, Jul 25, 2008 at 8:49 AM, Barry Rowlingson <
[EMAIL PROTECTED]> wrote:

> 2008/7/24 Laurent Gautier <[EMAIL PROTECTED]>:
>
> > Unless someone steps forward to help, design and implementation
> > of an R->Python interface may have to wait...
>
>
>  It should be possible to write some C code, link to libpython and use
> the python C api (http://docs.python.org/api/api.html) with the R
> C-level API. I can't see any reason why this wouldn't work (some R
> packages such as Rgdal link to external libraries) but you'd have to
> learn the C- APIs for python and R!
>
>  The kludgy way of doing it is to get your R function to save its
> parameters in a .RData file, then use system() to start a python
> script, then have the python script use Rpy to read the .RData into
> python variables and do the analyses. Then reverse to get the answer
> back into R.
>
>  However it might just be easier to write the inputs to a plain text
> file and save starting up a new R process in the python script
> (especially if your input data is small).


Yes. Out of these three kludge options the first and third did occur to me.
too A self-made Python--C--R link is not really an option because of the
time spent on the learning curve (am not too familiar with either of the
APIs). It's just not worth it, because you kind of get the worst of both
worlds (hard to develop and packaging becomes trickier because of having to
compile your C parts for Windows/Mac/Linux).

The .RData + Rpy kludge actually seems like a tempting ugly hack :) Although
I'm considering just an R rewrite of the application because then there are
no dependency troubles or hacks and I somehow think people might be more
prone to use and contribute to it that way.

Barry
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to