[R] driving R from Python (calldll?)
Duncan Temple Lang
duncan at research.bell-labs.com
Thu Jan 24 18:05:19 CET 2002
There is no major problem porting the RSPython package to Windows. I
believe I have completed all but one step of this a few months ago and
then got side-tracked. The remaining task is to be able to use the
mingw compiler to create the RSPython.dll that R will load and link
against the python libraries. Conceptually this is easy. All that is
needed is to locate a linkable Python library. This is the same task
that was needed for getting the SJava, XML, ... packages to work on
windows. Hopefully I can remember how to do this.
I am currently resolving a problem in my Windows compilation setup.
If/when this is completed, I'll try to build Window's binaries for
qmost of the different packages about which people have expressed an
interest in having on Windows: Java, XML, RGtk, RSPython, Rggobi,
RGnumeric,....
Farrar.David at epamail.epa.gov wrote:
>
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
_______________________________________________________________
Duncan Temple Lang duncan at research.bell-labs.com
Bell Labs, Lucent Technologies office: (908)582-3217
700 Mountain Avenue, Room 2C-259 fax: (908)582-3340
Murray Hill, NJ 07974-2070
http://cm.bell-labs.com/stat/duncan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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