[R] [R-pkg] New packages pmg, gWidgets, gWidgetsRGtk2

From: j verzani <pmgrgui_at_gmail.com>
Date: Fri 06 Oct 2006 - 14:39:34 GMT

I'd like to announce three new packages on CRAN: pmg, gWidgets, and gWidgetsRGtk2.

--John Verzani


  The pmg package for R provides a relatively simple graphical user interface for R in a manner similar to the more mature RCmdr package. Basically this means a menu-driven interface to dialogs that collect arguments for R functions. This GUI was written with an eye towards simplifying the learning curve of R for introductory statistics students.
  The pmg package uses the GTK toolkit via the RGtk2 (1) package by Michael Lawrence. Some features are

2 gWidgets

  The RGtk2 package is interfaced with the new gWidgets package, which may be of independent interest to those who would like to add GUI elements to their work. The gWidgets package provides a toolkit-independent API for interactive GUIs based on the iWidgets API of Simon Urbanek, with additional suggestions given by Philippe Grosjean and Michael Lawrence. The gWidgetsRGtk2 package provides the link between gWidgets and RGtk2, allowing the GTK toolkit to be used through gWidgets. It is possible for others to write a link between gWidgets and some other GUI toolkit.
  The gWidgets API is nowhere near as rich as the RGtk2 interface to the toolkit, but is much easier to learn. It is well-suited for simple applications or for rapid prototyping of more complicated applications. An accompanying vignette shows many examples of its use. For a simple, but not trivial, illustration, this code, following chooseCRANmirror(), shows how to use gWidgets to make a dialog for selecting a CRAN mirror. <<

    win = gwindow("Select a CRAN mirror")     size(win) <- c(600,400)
    tbl = gtable(utils:::getCRANmirrors(), chosencol=4, filter.column=2,

      handler = function(h,...) {
        URL = svalue(tbl)
        repos <- getOption("repos")
        repos["CRAN"] <- gsub("/$", "", URL[1])
        options(repos = repos)


  Two widgets are created: a base window to be a container for the widget that displays a table, which has a few extra arguments shown to indicate its flexibility. The widget to display a table allows a user to double click on a row and expect some action to happen. In this case, the handler for this action sets the value of repos. The svalue() method is used to retrieve the selected value from a widget and the dispose() method is used to remove a window.

3 Installation

   Installing pmg requires two steps: installing the GTK libraries and installing the R packages.

3.1 Installing the GTK libraries

  RGtk2 requires relatively modern versions of the GTK libraries (2.8.0 or higher). Installing the libraries under Windows is easy. Download the runtime installer from sourceforge (2). With linux you may need to upgrade base GTK libraries. The GTK libraries are available under Mac OS X using X11. (I haven't confirmed that is possible for RGtk2 to use the native port of GTK.)
  More details at RGtk2's home (3).

3.2 Installing the R packages

  The following R packages are needed: RGtk2, cairoDevice, gWidgets, gWidgetsRGtk2, and pmg. All can be downloaded from CRAN. The gWidgetsRGtk2 depends on gWidgets and RGtk2 and suggests cairoDevice so you may be able to get away with
  > install.packages(c("gWidgetsRGtk2","pmg"),

      dependencies=c("Depends", "Suggests"))

4 Starting

  The GUI is started when the pmg package is loaded. If the GUI is closed, it may be restarted by calling pmg(). An accompanying vignette (vignette("pmg")) describes the GUI.


  Send comments or suggestions to pmgRgui@gmail.com.

 (1) http://www.ggobi.org/rgtk2

 (2) http://gladewin32.sourceforge.net/modules/news/

 (3) http://www.ggobi.org/rgtk2

 This document was translated from LaTeX by HeVeA


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Oct 07 00:51:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 06 Oct 2006 - 17:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.