Hi. This is my first post to this list, I seem to be graduating to from the r-help list. :-) I'm trying to wrap my R package in a GUI such that when the user launches the app, they see my GUI window and never interact with the R console at all. I don't have any fancy requirements for the GUI itself-- all it needs to do is collect input from the user and pass the input as arguments to an R function, which writes the results to a file. I read the R Extensions Manual section about GUIs, and it seems like overkill to write the thing in a compiled language and link against R as a library when there are dozens of different interpreted cross-platform GUI toolkits out there. Does anybody know of any functioning examples of packages (or other add-ons) with GUIs that run R silently in the background which I can study? Do they use the "R CMD BATCH" mechanism, or something else? Thanks.
>>>>> "AB" == Alex Bokov <bokov at uthscsa.edu> >>>>> on Mon, 01 Jun 2009 00:24:58 -0500 writes:AB> Hi. This is my first post to this list, I seem to be AB> graduating to from the r-help list. :-) well.... AB> I'm trying to wrap my R package in a GUI such that when AB> the user launches the app, they see my GUI window and AB> never interact with the R console at all. I don't have AB> any fancy requirements for the GUI itself-- all it needs AB> to do is collect input from the user and pass the input AB> as arguments to an R function, which writes the results AB> to a file. AB> I read the R Extensions Manual section about GUIs, and AB> it seems like overkill to write the thing in a compiled AB> language and link against R as a library when there are AB> dozens of different interpreted cross-platform GUI AB> toolkits out there. Does anybody know of any functioning AB> examples of packages (or other add-ons) with GUIs that AB> run R silently in the background which I can study? Do AB> they use the "R CMD BATCH" mechanism, or something else? There's a dedicated "Special Interest Group" mailing list for answering / discussing such questions : R-SIG-GUI Please subscribe and ask there --> https://stat.ethz.ch/mailman/listinfo/r-sig-gui Regards, Martin Maechler, ETH Zurich
Hi, The following idea only partially answers your question.... I have successfully written a GUI using the tcl/tk package that ships with standard R. It is then possible (in Windows) to create a shortcut icon that runs the following command: C:\R\R-2.8.1\bin\R.exe --vanilla -e library(SuperCurveGUI);sc(); Note two features: [1] the first part of the -e switch loads the library containing the GUI [2] the second part (after the semicolon) launches the GUI If you make a "normal" shortcut this way, a batch window will open showing the ongoing R session, which is not quite what you want. However, if you adjust the shortcut to "Run: Minimized", then (most) users will never see the batch window, and will only see the GUI. The reasons that this only partially answers your question are [1] It is Windows-specific [2] I do not know how to set up the shortcut automatically upon installation. Kevin Alex Bokov wrote:> Hi. This is my first post to this list, I seem to be graduating to > from the r-help list. :-) > > I'm trying to wrap my R package in a GUI such that when the user > launches the app, they see my GUI window and never interact with the R > console at all. I don't have any fancy requirements for the GUI > itself-- all it needs to do is collect input from the user and pass > the input as arguments to an R function, which writes the results to a > file. > > I read the R Extensions Manual section about GUIs, and it seems like > overkill to write the thing in a compiled language and link against R > as a library when there are dozens of different interpreted > cross-platform GUI toolkits out there. Does anybody know of any > functioning examples of packages (or other add-ons) with GUIs that run > R silently in the background which I can study? Do they use the "R CMD > BATCH" mechanism, or something else? > > Thanks. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Alex, Kevin R. Coombes wrote:> The following idea only partially answers your question.... > > I have successfully written a GUI using the tcl/tk package > that ships with standard R. It is then possible (in Windows) > to create a shortcut icon that runs the following command: > C:\R\R-2.8.1\bin\R.exe --vanilla -e > library(SuperCurveGUI);sc(); Note two features: > [1] the first part of the -e switch loads the library > containing the GUI [2] the second part (after the semicolon) launches > the GUI > > If you make a "normal" shortcut this way, a batch window will > open showing the ongoing R session, which is not quite what you want. > However, if you adjust the shortcut to "Run: Minimized", then > (most) users will never see the batch window, and will only > see the GUI. > > The reasons that this only partially answers your question > are [1] It is Windows-specific [2] I do not know how to set > up the shortcut automatically upon installation.depending on how deep you want to dig into programming (aside from R), you could use any COM client (on Windows), e.g., Visual Basic, C# using statconnDCOM (just download and install the package rcom) or using Java (RServe) Thomas
Some possibilities: The Rcmdr package is a very good example of a GUI built using Tk (it does not hide the R program, but lets you do analyses using menus and dialogs). Rcmdr also has a plug-in mechanism to write extensions to it, depending on what you want to do, writing a simple extension to Rcmdr may be enough and a lot less work than creating your own from scratch. There are tools (Rpad, Rserve, and others) that allow web interfaces to R, that may work for you. There is the Rcom project uses R as a background tool for other programs, the most developed tool uses MSExcel as the GUI with R doing the heavy work behind the scenes. There are various examples of tools using the excel interface available. There is a lot of info at: http://www.sciviews.org/_rgui/ Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r- > project.org] On Behalf Of Alex Bokov > Sent: Sunday, May 31, 2009 11:25 PM > To: r-devel at r-project.org > Subject: [Rd] Recommendations for a quick UI. > > Hi. This is my first post to this list, I seem to be graduating to from > the r-help list. :-) > > I'm trying to wrap my R package in a GUI such that when the user > launches the app, they see my GUI window and never interact with the R > console at all. I don't have any fancy requirements for the GUI itself- > - > all it needs to do is collect input from the user and pass the input as > arguments to an R function, which writes the results to a file. > > I read the R Extensions Manual section about GUIs, and it seems like > overkill to write the thing in a compiled language and link against R > as > a library when there are dozens of different interpreted cross-platform > GUI toolkits out there. Does anybody know of any functioning examples > of > packages (or other add-ons) with GUIs that run R silently in the > background which I can study? Do they use the "R CMD BATCH" mechanism, > or something else? > > Thanks. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel