Re: [R] R user interface

From: jverzani <>
Date: Thu, 17 Jun 2010 16:57:59 +0000 (UTC)

Shubha Vishwanath Karanth <shubhak <at>> writes:

> Hi R,
> I have a an excel file with a lot of data. I need to create an user
> interface in R, which has one single screen. It needs to contain a right
> pane containing the click buttons for different countries (say). If the
> user clicks a country, then a chart needs to be created for that
> country, taking the data from Excel. Is this possible and which package
> helps me in doing this? Many thanks in advance.
> Thanks and Regards,

If you don't mind installing the GTK libraries, then the traitr package can be used here without too much difficulty. Here is what you can do for your request (a stripped down version of a demo in the vignette)

## sample data, replace me

d <- data.frame(country=c("US","US","Canada","Mexico"),
                x = rnorm(1:4),
                y = rnorm(1:4))


library(gWidgets) ## also gWidgetsRGtk2, cairoDevice options(guiToolkit="RGtk2")

countries <- unique(d$country)

dlg <- aDialog(items=list(

                 countryFilter=choiceItem(value=countries, values=countries,
                               multiple=TRUE, show_label=FALSE)
               help_string="Use filter to narrow",
               ## this is called when the countryFilter checkbox is clicked
               ## this draws the plot
               make_plot=function(.) {
                 countries <- .$get_countryFilter()
                 ## adapt this:
                 plot(y ~ x, data=d, subset=country %in% countries)
view <- aPanedGroup(aContainer("output"),
                    aFrame(label="Filter by:",
                           aFrame("countryFilter", label="Country")),


> Shubha Karanth
> This e-mail may contain confidential and/or privileged i...{{dropped:13}}
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 17 Jun 2010 - 16:59:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jun 2010 - 17:30:32 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive