[R-gui] [RGUI] Where do you start?

Philippe Grosjean phgrosjean at sciviews.org
Mon Jan 19 18:03:22 MET 2004


Erin Hodgess wrote:

>How would I start to build a GUI, please?
>Should I learn Visual Basic, please?

John Fox answered:

>When I programmed the Rcmdr GUI, I took a look at several options including
>Visual Basic, and concluded that, at present, Tcl/Tk via the tcltk package
>was the way to go. The tcltk package is one of the recommended packages,
>the resulting GUI works under all platforms, and the Windows distribution
>of R installs with a basic Tcl/Tk system. The GUI itself can be distributed
>as a standard R package.

>Beyond that, it's hard to give advice since you don't specify what the GUI
>will do, who will use it, on what platform(s) it will run, etc.

John is right, Tcl/Tk is largely advised for building GUIs for R. It has the
double advantage to run on all platforms and to be fully integrated into R:
it is now installed by default by the setup of R for Windows (I presume you
are interested by a GUI for Windows, since you speak about Visual Basic that
runs only under Windows).

At the time I started the SciViews project, it was not the case yet (four
years ago), and I choose Visual Basic for various reasons. The R(D)Com
server, a similar package from Duncan Temple Lang and R plugs (from
SciViews) do connect VB to R, if you really want to use VB, or VBA (i.e.,
the "macro" language of Excel) it is possible.

You do not give much details on which kind of GUI you want to build.
However, whatever your project, you should start form existing code for two
reasons:
1) You will learn faster from an existing example,
2) If possible, you could try to make your code compatible with the existing
project, in order to contribute to it instead of starting yet another
different R GUI project.

The last year, there where a couple of different, incompatible GUI projects
for R. Most of them are not evolving quickly, or are even idle (Rkwark,
ObveRsive, Brodgar,...)? The one that leads to a fully-working
implementation is R commander form John Fox, and it is 100% Tcl/Tk. A wise
choice in this context is thus to learn Tcl/Tk, and to build GUI extentions
that are "R commander-compatible", i.e., that use the same menuing system
and the same main window with a logging feature. Just start from the Rcmdr
package, learn its code (it is well written) and adapt it to your particular
needs.

***If everyone agrees to use R commander as a reference for buiding R GUI
for their particular application, then we will all move together in the same
direction***

... and we will be able to put all the various pieces of the puzzle together
one day... This will contrast with the situation until today, with all those
different projects moving in different and incompatible directions: what a
waste of time and effort!

I recently adapted SciViews to make it compatible with R Commander. The
lastest version (0.3.3, see http://www.sciviews.org/software/SciViews.htm)
provides some additional nice features you do not find in the current R + R
commander binome: syntax highlighting, code tips, electronic reference
cards, assistants, automatic installation of Rcmdr library, etc... and very
soon an object explorer and views (a graphical way to explore R objects).
So, Tcl/Tk dialog boxes "a la R commander" also run under SciViews (Windows
platform only), if you prefer it to the simpler default Rgui user interface.

Best,

Philippe Grosjean

.......................................................<°}))><....
 ) ) ) ) )
( ( ( ( (   Prof. Philippe Grosjean
\  ___   )
 \/ECO\ (   Numerical Ecology of Aquatic Systems
 /\___/  )  Mons-Hainaut University, Pentagone
/ ___  /(   8, Av. du Champ de Mars, 7000 Mons, Belgium
 /NUM\/  )
 \___/\ (   phone: + 32.65.37.34.97, fax: + 32.65.37.33.12
       \ )  email: Philippe.Grosjean at umh.ac.be
 ) ) ) ) )  SciViews project coordinator (http://www.sciviews.org)
( ( ( ( (
...................................................................



More information about the R-SIG-GUI mailing list