The pmg GUI

1  pmg

The pmg package for R provides a simple to use, lightweight GUI aimed towards easing the instruction of introductory statistics using R.
  • To learn more: pmg

  • The pmg package needs the RGtk2 package, which in turn needs the GTK+ libraries to be installed. An install script for windows is here installpmg.R. This can be sourced into an R session:
    source("http://www.math.csi.cuny.edu/pmg/installpmg.R")


2  gWidgets

The package relies on the gWidgets package, which offers a relatively simple way of writing graphical user interfaces within R.
  • To read more: gWidgets.

  • The gWidgets package is an interface to different graphical toolkits: RGtk2, tcltk and (to some extent) rJava. As such, a toolkit specific package must also be installed. (These are on CRAN, the only issue is if the underlying graphical toolkits are not installed.)

  • The gWidgetsWWW package brings the gWidgets interface to the web. However, it does not depend on gWidgets. This package has in internal web server for standalone use and can be run with RApache for serving R-driven web pages.

3  The traitr package

The traitr package is different interface for programming GUIs that relies on gWidgets in the background. It can greatly simplify certain types of GUI creation.

4  News

Some news about the package (not kept up to date). See the package NEWS file for more information.

01/13/2010: New package: traitr

A new package, traitr, is being released which uses gWidgets as a backend, but provides a much different interface for creating GUIs.

11/17/2008: New versions of gWidgets, gWidgetsRGtk2, gWidgetstcltk, gWidgetsrJava

A few additions (gaction, tooltip), and a lot of bug fixes.

07/18/2008: New package gWidgetsWWW

The gWidgetsWWW package leverages the Rpad infrastructure allow dynamic webpages to be built using the gWidgets API. In addition the Rpad package for R, these pages use the EXTJS javascript libraries available at www.extjs.com. Att this point, much of the gWidgets API is implemented, but certainly not all. In addition, some extenstions are being tried out. The gaction contructor is used to make reusable action components for menubars and buttons. The ggooglemaps constructor gives some access to the Google maps interface. Bug reports and comments are welcome.

07/18/2008: gWidgetstcltk needs tcl/tk 8.5

The gWidgetstcltk package now needs tcl/tk version 8.5 or newer installed. This change was made when R 2.7.0 shipped this version for windows. The 8.5 version allows for many more widgets, that prior to this were hacked or ignored in gWidgetstcltk. For windows this is not issue, for linux users not a big issue, for Mac OS X users, one needs to (I think) compile the tcl/tk libraries from source (www.tcl.tk). This has been confirmed to work for gWidgetstcltk under OS X 10.5, but YMMV.

07/18/2008: New versions of gWidgetsRGtk2, tcltk and rJava uploaded

Basically these are minor bugfixes and documentation tweaks to make CRAN happy. Fixes include: gframe in gWidgetstcltk and fixes to methods for gradio, gvarbrowser and gpanedgroup in gWidgetsRGtk2. Future changes (hopefully) will fix up the gdf constructor in gWidgetsRGtk2 and documentation imporvements to gWidgets itself.

05/17/2008: gWidgetsRGtk2_0.0-34

New version which fixes a bug in gcheckboxgroup and add to the method [<-.

10/30/2007: Stack smashing issue

Under Kubuntu the following example was throwing a stack smashing error with R-2.6.0:


library(RGtk2)

w = gtkWindowNew("test")
b = gtkButton("click me")
w$Add(b)

connectSignal(b,"clicked",function(...) {
 e = simpleError("test")
 stop(e)
}
If you see this error, recompile after first setting
export CFLAGS="-fno-stack-protector"  

09/24/2007: New versions of gWidgets, gWidgetsRGtk2, gWidgetsrJava, and gWidgetstcltk

I uploaded new versions of these 4 packages to CRAN today. Mostly bug fixes:

  • Changed rJava so that it works without JGR. This was made possible in rJava-0.5-0.
  • fixed gtree issue with icons in RGtk2
  • Fixed gtable in tcltk. Made obj[,] <- c() work. (Not in RGtk2 though!)
  • Fixed bug in rJava with gbutton and glabel

09/19/2007: Added a set of examples

Look at the Examples directory to see a number of annotated examples of how gWidgets can be used.

07/12/2007: New version of pmg uploaded to CRAN

A new version of pmg was uploaded to CRAN. There were a few bug fixes. As well, the layout changed slightly. The Commands tab is no longer in the main notebook, but rather appears below it. This makes it more accessible and when a dialog is used the output appears to the user. It might take more screen real estate to work. As well, I think I managed to avoid requiring iplots (and hence rJava) and reshape from being installed when the package is installed. The GUI has some entries to enhance these two packages, but they are not necessary.

07/12/2007: A new package gWidgetstcltk is uploaded to CRAN

This package incorporates tcltk into the gWidgets framework. Although not all the widgets are implemented, due to a desire to make this work with the base tcltk libraries, many are.

The major difference between this implementation and gWidgetsRGtk2 and gWidgetsrJava is how containers are handled. In the latter two, a container can be specified for a widget after the widget is constructed, in gWidgetstcltk the container must be specified when a widget is constructed. So instead of using something like:

b = gbutton("click me")
g = ggroup(cont=gwindow("example"))
add(g, b, expand=TRUE)
you would write
g = ggroup(cont=gwindow("example"))
b = gbutton("click me", container=g, expand=TRUE)
The expand=TRUE is there to show that argumentst to add may be passed into the widget using the ... feature of R.