[R] RPy

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Apr 21 10:46:06 CEST 2008

Doran, Harold wrote:
> I'm curious if there are users of RPy on this list. I've recently
> created a gui front end using Tkinter for some python scripts I've
> written for some of our internal operations and I am quite pleased with
> how this program works. 

> Currently, I can use py2exe to create a executable that allows for this
> gui to appear and for all python scripts to run even if the user doesn't
> have python on their machine. So (maybe) in theory if I can link Rpy to
> my gui to run R, I can then use py2exe to compile it and that would
> allow the user to run the functions even if R isn't on the machine.

  You're confounding having something on a machine with having something 
installed on a machine. Py2exe works by bundling all of python with the 
exe file, so in a sense the target machine does have python on it, just 
not installed in C:\Python in the usual way. If you give someone four 
different py2exe programs, they end up having four lots of python.

  For Py2exe to work with R so that people wouldn't have to install R, 
it would mean that Py2exe would have to bundle up all of R in the exe 
file. So that's the R binary, the .dll, every library package needed and 
so on. In a word, 'ick!'.

> I realize this is a broad question and has no minimal commented code.
> But, if anyone has some experience using Rpy, Tkinter and R I can come
> up with a small example to see if we could work out a possible way to
> use Tkinter to run R
  Rpy is the way to go, but you will have to get your users to install 
R, python and Rpy. It's only a few clicks and they only have to do it once.

  Personally I've used PyQt to create python programs with Qt GUIs that 
call R and it all works very nicely.


More information about the R-help mailing list