The R-wxPython Package

Questions? Email James Wettenhall at

R-wxPython Webpage Contents:


The R-wxPython package is an R interface to the wxWidgets GUI toolkit, communicating with it via the Python scripting language (using the R package RSPython).

It is not necessary to install wxWidgets in addition to wxPython, but the link is included here to acknowledge the original source which wxPython is based on.

Download the R-wxPython Packge

The latest version of wxPython is 0.2.4. (IT IS ONLY IN THE PROTOTYPING STAGE, SO EXPECT THINGS TO CHANGE DRAMATICALLY IN FUTURE VERSIONS). You will need to install Python 2.2.x and make sure that its shared library (e.g. python22.dll) can be found within your PATH (environment variable). You will need a recent version of RSPython (>=0.5-3). The Windows binary on the OmegaHat page for RSPython is currently not up-to-date, which is why another temporary RSPython webpage is mentioned above. The R-wxPython package can be installed with:

PLEASE USE R 1.8.1 or later, Python 2.2.x, and wxPython 2.5.x

Drawing dialogs with BoaConstructor

One of the nice things about wxPython, is that you can draw dialogs with BoaConstructor. For an example of using this with R, see:

Compiler difficulties with linking R-wxWidgets directly (without Python)

It would be nice to build a direct interface between R and wxWidgets without Python. On the other hand, having a scripting language (Tcl) in between R and the Tk GUI toolkit is not too bad, and it is a bit of work to interface R with an object-oriented C++ library (wxWidgets), especially because it is quite fussy about which compilers it likes under Windows: (Visual C++ or dev-c++ with MinGW), whereas it is nice to be able to build R packages and R itself from the command-line, rather than from an Integrated Development Environment (IDE). Generally, R packages with C code only (not C++), are easier to make truly "platform-independent". Preferred C++ compilers, IDEs vary between operating systems.


One possibility for the future is to use an automatic tool such as GCC_XML / Cable to provide an R interface to the wxWidgets C++ library by going via XML. The ITK GUI toolkit (originally in C++) has been ported in this way, so that it can be accessed from the Tcl (interpreted) scripting language. Presumably the same sort of thing could be done for R (also an interpreted language with an XML interface), but this could take some work, so for now I'm going through Python.

R-wxPython talk slides from useR!2004

Questions? Email James Wettenhall at