An Introduction to GUI Development using R

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

Introduction to Eclipse cs112b1 – Lab01 by Rui Shi.
RDz and Process Integration Using Menu Manager and HATS to customize your RDz installation David Myers.
Microsoft Office SharePoint Portal Server 2007 Introduction to InfoPath Forms Services Daryl L. Rudolph.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Converting S-Plus Applications into R Andy Nicholls
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
NetBeans IDE Tal Maoz Na’ama Zahavi.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
CS 225 Section 1 Spring Topics Software design Correctness and Efficiency Inheritance Data structures –Lists, Stacks, Queues –Trees –Sets, Maps.
1 Lab Session-I CSIT120 Spring2001 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 continues (Session.
Image Management System Supervisor Dmitry Davidov Students Tanya Kostanovich Roma Kagan.
CS0007: Introduction to Computer Programming Setting Up Java.
UFCFX5-15-3Mobile Device Development Android Development Environments and Windows.
How Open is OpenInsight?
Will Smythe Senior Program Manager Developing Java projects on Visual Studio Online with Team Explorer Everywhere.
Swing part-one Eriq Muhammad Adams J
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
October 30, 2007S. Weigert / Y. HAN1 Working with Eclipse-Ingres RUBIS Autumn 2007.
Definition of the SDK for FIspace Augusto Morales & Hector Bedón UPM.
An Introduction to Visual Basic
CENT 305 Information Systems Security Linux Introduction.
Tcl/Tk package in R Yichen Qin
Linux Audio Mangler Project Design Presentation Yu Chong Hector Urtubia Tony Zuliani.
GUIs for Applets Introduction Applets and Swing/JFC Alternatives to Swing Look-and-Feel issues Example applet graphical user interfaces.
JCreator Tonga Institute of Higher Education. Programming with the command line and notepad is difficult. DOS disadvantages  User Interface (UI) is not.
Introduction In The Name Of Allah, The Beneficent, The Merciful.
Introducing the Eclipse Visual Editor David Gallardo.
Understanding Xamarin Development Matt
Introduction to Windows Programming
Introduction to Eclipse. What is Eclipse? An Integrated Development Environment Provides many features to ease C++ programming (and others, e.g. C/Java)
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
A New Approach to Java Clients Robert Buffone Chief Architect Nexaweb Technologies By
GUI With GTK+ Under Linux Fanfan Xiong. Introduction GTK+ (GIMP toolkit) : A library for creating graphical user interfaces(GUI) Two examples developed.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Installing and Developing Programs in Python. Installing Python is pre-installed on most Unix systems, including Linux and MAC OS X The pre-installed.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
Introduction to Eclipse Al-Zahra Univerisity Advanced Programming Arash N. Kia.
H.G.Essel: Go4 - J. Adamczewski, M. Al-Turany, D. Bertini, H.G.Essel, S.Linev ROOT 2002 GSI Online Offline Object Oriented Go4.
Copyright © 2012 MICS‘12 and Curt Hill Development Systems: A Review Curt Hill Professor of Math and Computer Science Valley City State University
Intro to. Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs.
Introduction to CADStat. CADStat and R R is a powerful and free statistical package [
Intoduction to Andriod studio Environment With a hello world program.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Tcl/Tk Part 2.
Getting Started NX Journaling Jeff Roark Yanfeng Automotive Interiors.
Introduction to Android Programming
Chapter 1 Introduction to Visual Basic
Dive Into® Visual Basic 2010 Express
1/10/2018 9:33 PM Cloud Roadshow © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO.
CSC 222: Object-Oriented Programming
Introduction to Computer CC111
Chapter Topics 15.1 Graphical User Interfaces
Geertjan Wielenga This presentation introduces Swing Application Framework and Beans Binding JSRs. These are two new JSRs.
R Programming.
Understand Windows Forms Applications and Console-based Applications
Getting Started ARCS Lab..
Introduction to R.
Social Media And Global Computing Introduction to Visual Studio
Java External Libraries & Case Study
The Basic Usage and The Event Handling in Glade.
Chapter 15: GUI Applications & Event-Driven Programming
Graphic Libraries for The User Interface
Basic Concepts of The User Interface
CMPE 135: Object-Oriented Analysis and Design March 14 Class Meeting
Presentation transcript:

An Introduction to GUI Development using R

Overview Introduction Programming for GUIs R Interfaces GUIs for programming Programming for GUIs GUIs for teaching how to program GUI task-oriented applications gWidgets package Integrating R into other applications GUI deployment

Introduction R Interfaces/Console alternatives RStudio Programmed in C++ and GTK+ JGR Java Revolution R Productivity Environment (RPE) MS Visual Studio Red-R (Open Source visual programming for R SciViews (extends Komodo edit)

GUIs for Programming (code editors) R internal editor (on Mac!) Emacs + ESS Eclipse + StatET Gvim/Vim-R Notepad++ / NppToR WinEdt/RWniEdt ($30!!!) Tinn-R (MS Windows only) jEdit (doesn't pass code to R)

GUIs to learn programming R Commander (Rcmdr package) Satistical analysis functions RKWard (Linux only)

Poll from KDnuggets.com (data miners!)

GUI Programming using R gWidgets package written by J. Verzani “gWidgets provides a toolkit-independent API for building interactive GUIs.” At least one of gWidgetstcltk, gWidgetsRGtk2, gWidgetsQt (on R-Forge only) and qWidgetsrJava needs to be installed.” i.e. GUI toolkits must be installed (except Tcltk, pre-installed, default) the user can switch between GUI toolkits with relative ease and can write code in a toolkit independent way Well, not quite

GTK+ toolkit www.gtk.org

gWidgets functions

GUI contruction using gWidgets Use containers (in ggroup, gwindow, gnotebook functions) to nest widgets Handlers i.e. event handling, define the executed operation Handlers can be added after the GUI is created e.g. addHandlerClicked(…) Drag-and-drop is also featured in gWidgets Demo.... library(gWidgets) options("guiToolkit"="RGtk2") win <- gwindow("Hello World, ad nauseum", 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("Hello world", container=group) obj <- gtext("Hello world", 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 Relatively small questionnaire resulting in 800 variables! Variables names themselves are not very useful e.g. “Q001”. Great scope for programming error Variable labels (the actual questions) contain the information on what is collected With the concept of variable names dropped, an interactive GUI might work better with variable labels than programming!

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 Begin with a search & replace dialogue screen How would you design it (so that it would be a better option than just using grep or regexpr)? 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 Additional dialogs and functions for Deducer DeducerPlugIn Example Deducer Plug-in Example DeducerPlugInScaling Reliability and factor analysis plugin DeducerSpatial Deducer for spatial data analysis DeducerSurvival Add Survival Dialogue to Deducer DeducerText Deducer GUI for Text Data

gWidgets versus Deducer Deducer has a slightly lower level library, but more flexible and compatible with JGR Deducer requires you to explicitly specify positions of widgets, and is a little more verbose when you come to add event handling logic Visit www.r-bloggers.com for a discussion

Other R GUI packages and tools (which I know little about!) PBS (Pacific Biological Station) packages Rattle (data mining GUI) Brodgar (used for class-room teaching etc.) pmg (poor man’s GUI, similar to Rcmdr)

Current List of Packages with tools for GUI development or utilize a programmed GUI* *as of January 2013

Package description ade4TkGUI GUI for ade4 package AtelieR Basic statistical inference & bayesian analysis BiodiversityR Biodiversity, suitability, community ecology analysis biOpsGUI Basic image operations BiplotGUI Interactive Biplots in R CADStat Statistical methods useful for causal assessment caGUI A Tcl/Tk GUI for the functions in the ca package cncaGUI Canonical Non-symmetrical Correspondence Analysis DALY Stochastic DALY calculations detrendeR Start the detrendeR Graphical User Interface (GUI) digeR GUI tool for analyzing 2D DIGE data GGEBiplotGUI GGEBiplotGUI: Interactive GGE Biplots in R GrapheR Multi-platform GUI for drawing customizable graphs MDSGUI A GUI for interactive MDS in R MergeGUI A GUI for Merging Datasets in R Metabonomic GUI for Metabonomic Analysis

Package description migui Graphical User Interface of the mi Package MissingDataGUI A GUI for Missing Data Exploration MSeasyTkGUI multibiplotGUI Multibiplot Analysis in R mutossGUI A graphical user interface for the MuToss Project PBSadmb ADMB for R Using Scripts or GUI PMSddesolve Solver for Delay Differential Equations PBSmapping Mapping Fisheries Data and Spatial Analysis Tools PBSmodelling Interact with Models, Explore Data, Dynamic Presentations playwith A GUI for interactive plots using GTK+ pmg Poor Man's GUI ProgGUIinR book "Programming Graphical User Interfaces in R" QCAGUI QCA Graphical User Interface R2STATS Fit and compare GLM and GLMM in R RandForestGUI Random Forests RenextGUI GUI for Renext

Package description ResearchMethods GUIs to help teach statistics to non-statistics students reshapeGUI A GUI for the reshape2 and plyr packages RPMG Interactive R analysis sessions RunuranGUI A GUI for the UNU.RAN random variate generators Rz GUI Tool for Data Management like SPSS or Stata sculpt3d A simple toolbar GUI for brushing RGL plots sdcMicroGUI Graphical user interface for package sdcMicro SeqGrapheR Graph based visualization of cluster of DNA seq reads Sim.DiffProcGUI Simulation of Diffusion Processes speedR A GUI based importing and filtering tool TGUICore Teaching GUI - Core functionality TGUITeaching Teaching GUI - prototype tourrGUI A Tour GUI using gWidgets traitr creating GUIs (traits UI module for python) WMCapacity Bayesian working memory models x12GUI X12 - Graphical User Interface

Package description Common JavaJars Useful libraries for building a Java based GUI fgui Function GUI miniGUI tktcl quick and simple function GUI

Considerations in GUI development & deployment Which Widget library? GTK+, Java, Qt? Program the UI or use a UI designer? e.g. QtDesigner Choice of software for GUI deployment? R (gWidgets package etc.) Python (wxPython, PyQt, PyQt4 libraries) R/Python integration (call R using Rpy, Rpy2) 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) Rook package Embed R in the Apache web server Rook package Provides an interface to build web-applications with rApache gWidgetsWWW It’s 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 Lawrence and Verzani book (2012)  gWidgets package vignette

Final comments Don’t 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!