1 PMG
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 gWidgets package. The pmg package uses the GTK toolkit via the RGtk2 package by Michael Lawrence. Some features are- The GUI works under Windows, Mac OS X, Linux/X11
- The GUI takes advantage of GTK's drag-and-drop capabilities.
- Several dialogs for analyses performed in an introductory statistics course can be used simply by dragging variables around.
- With the cairoDevice package, the GUI provides a notebook interface to a graphics device that allows UNIX users to easily manage multiple graphics devices.
2 Installation
Installing pmg requires two steps: installing the GTK libraries and installing the R packages. If the GTK libraries are already installed, then pmg may be installed with
> install.packages("pmg", dep=TRUE)
(You may need type=ßource" under Mac OS X.)
For Windows users, the
following command automates the installation including installing GTK
if needed:
> source("http://www.math.csi.cuny.edu/pmg/installpmg.R")
For Mac OS X users, the gtk libraries can be found bundled up at
http://r.research.att.com/gtk2-runtime.dmg. These are to be run
from within an X11 session (not the R GUI for Mac).
2.1 Installing the R packages
The following R packages are needed: RGtk2, cairoDevice, gWidgets, gWidgetsRGtk2, and pmg. Install them in this order, as some depend on others to be installed first. All can be downloaded from CRAN. As the "Suggests" value for pmg contains gWidgets and gWidgetsRGtk2 which in turn suggest RGtk2 and cairoDevice this can be achieved from the command line with
install.packages("pmg", dep = TRUE)
You may need to adjust the location where the libraries will be
installed if you do not have the proper permissions.
3 Try out pmg
The package may be started with> library(pmg)A screenshot can be seen at http://www.math.csi.cuny.edu/pmg/Screenshots. If the GUI Is closed, it may be restarted with the command pmg(). The pmg package provides a short vignette with some examples. You may read this with the command
> vignette("pmg") # read about some examples
4 gWidgets
The pmg GUI is written using the gWidgets package. This package trades off the power of directly using RGtk2 for a more R-like interface. It can be used independently of pmg or to add to pmg. To learn more see http://www.math.csi.cuny.edu/pmg/gWidgets.5 Comments
Send comments or suggestions to pmgRgui@gmail.com.File translated from TEX by TTH, version 3.67.
On 9 Oct 2007, 12:30.
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.
![[DIR]](http://wiener.math.csi.cuny.edu/pmg/images/i-directory-12.png)
![[FILE]](http://wiener.math.csi.cuny.edu/pmg/images/i-regular-12.png)