[R] driving R from Python (calldll?)

Farrar.David@epamail.epa.gov Farrar.David at epamail.epa.gov
Thu Jan 24 17:43:36 CET 2002


Thanks for your time.  We'll look into Baier's DCOM interface.

What I am doing at the moment is to have Python write an R program that
does some curve fits, run the program using Rterm, piping the output to
a disk file, then parse the output with Python.  If there is some tool I
can easily use to reduce the complexity of the program, then I would
consider using it.

DF




                                                                                           
                    Prof Brian                                                             
                    Ripley               To:     David Farrar/DC/USEPA/US at EPA              
                    <ripley at stats        cc:     r-help at hypatia.math.ethz.ch               
                    .ox.ac.uk>           Subject:     Re: [R] driving R from Python        
                                         (calldll?)                                        
                    01/24/2002                                                             
                    02:35 AM                                                               
                                                                                           
                                                                                           




On Wed, 23 Jan 2002 Farrar.David at epamail.epa.gov wrote:

> Sam Rushing's Python extension 'calldll' will supposedly give me
access
> to any DLL,
> and presumably R.DLL in particular, from Python.  I have no experience
> manipulating DLLs as
> yet.  I am learning Python.  I can't find any simple step-by-step
> instructions on how
> to get done what I want to do.  Does anyone have experience with this?
> Is there a
> better way?  Of course, one can use Rterm with DOS piping commands.

Presumably this is for Windows.  You can't use R.dll in isolation.
What you can do is the use the DCOM interface written by Thomas Baier
that
you will find on CRAN, which provides a completely standard Windows
interface that I am sure Python can talk to.  My suspicion is that
this would be much easier than porting RSPython to Windows, because no
work would be involved on the R side.  Conversely, it will give you
less,
but you don't say anything about `to get done what I want to do'.

BTW

`Of course, one can use Rterm with DOS piping commands'

isn't really true.  Rterm is a Windows program, not a DOS program.  You
can certainly do it on Windows NT/2000/XP, but pipes are limited on
95/98/ME, and DOS can't pipe to Windows programs.  Guido and I failed to
get this sort of thing to work from R for pipe connections under
95/98/ME,
and found lots of things which did not work as documented nor as on NT
in
the process.  Also, Perl's system() has problems with redirection and
pipes on 95/98/ME.  So beware!

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595





-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list