An Introduction To GUI Programming Using R
An Introduction To GUI Programming Using R
using R
Overview
Introduction
R Interfaces
GUIs for programming
Introduction
R Interfaces/Console alternatives
RStudio
Programmed in C++ and GTK+
JGR
Java
GTK+ toolkit
www.gtk.org
gWidgets
functions
Demo....
library(gWidgets)
options("guiToolkit"="RGtk2")
win<gwindow("HelloWorld,adnauseum",visible=TRUE)
group<ggroup(horizontal=FALSE,container=win)
obj<gbutton("Hello...",container=group,handler=function(h,...)
gmessage("world"))
obj<glabel("Hello...",container=group,handler=function(h,...)
gmessage("world"))
obj<gcombobox(c("Hello","world"),container=group)
obj<gedit("Helloworld",container=group)
obj<gtext("Helloworld",container=group,font.attr=list(style="bold"))
Sample Problem
Survey conducted to see changes in HIV and
non-HIV services in sub-Saharan Africa
Conducted across health centres & hospitals, also
individual health-worker data, in several sub-saharan
Africa countries
Solution
Create new sets of labels
which work as indexes
These can be used to filter, manage and
analyze data
- Restructuring of data not required
Demo...
Deducer
An intuitive, cross-platform graphical data
analysis system
Deducer is based upon rJava and provides
access to the Java Swing Network
Related Packages
Description
DeducerExtras
DeducerSpatial
DeducerSurvival
DeducerText
Package
description
ade4TkGUI
AtelieR
BiodiversityR
biOpsGUI
BiplotGUI
Interactive Biplots in R
CADStat
caGUI
cncaGUI
DALY
detrendeR
digeR
GGEBiplotGUI
GrapheR
MDSGUI
MergeGUI
Metabonomic
Package
description
migui
MissingDataGUI
MSeasyTkGUI
multibiplotGUI
Multibiplot Analysis in R
mutossGUI
PBSadmb
PMSddesolve
PBSmapping
PBSmodelling
playwith
pmg
ProgGUIinR
QCAGUI
R2STATS
RandForestGUI
Random Forests
RenextGUI
Package
description
ResearchMethods
reshapeGUI
RPMG
RunuranGUI
Rz
sculpt3d
sdcMicroGUI
SeqGrapheR
Sim.DiffProcGUI
speedR
TGUICore
TGUITeaching
tourrGUI
traitr
WMCapacity
x12GUI
Package
description
Function GUI
miniGUI
Considerations in GUI
development
&
deployment
Which Widget library?
GTK+, Java, Qt?
Sage (www.sagemath.org)?
Sage uses existing open-source libraries wherever they exist!
See sagemath.org, writen in Python & Cython, not supported by
MS Windows
Web-applications
rApache project (www.rapache.net)
Embed R in the Apache web server
Rook package
Provides an interface to build webapplications with rApache
gWidgetsWWW
Its independent of gWidgets!
Use JavaScript libraries, rapache
Shiny in Rstudio!!!
Documentation
Lots of material on the web
Journal of Statistical
Software (Vol. 49)
Special issue of R on GUIs
Final comments
Dont write a GUI which you hope others will find
useful. Write one you use yourself and hopefully it may
be of use other people
A successful GUI will requires the right balance of detail
and simplicity
Writing a GUI using R may not be the optimal
deployment of a GUI, but it is nevertheless easy to do!
It is my opinion that programing from within R is a very good
way to get a working GUI quickly, but you are better served
leaving R for something polished and professional looking.
R-Blogger
Thank you!