BUILDING INTERACTIVE, R-POWERED WEB APPLICATIONS WITH SHINY Jeff Allen, Dallas R Users Group 2/9/2013.

Slides:



Advertisements
Similar presentations
1 CGICGI Common Gateway Interface Server-side Programming Lecture.
Advertisements

Test Automation Framework Ashesh Jain 2007EE50403 Manager Amit Maheshwari.
DT228/3 Web Development WWW and Client server model.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Server-Side vs. Client-Side Scripting Languages
The Application Layer Chapter 7. Electronic Mail Architecture and Services The User Agent Message Formats Message Transfer Final Delivery.
DT211/3 Internet Development Application Internet Development Application.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
CS 290C: Formal Models for Web Software Lecture 1: Introduction Instructor: Tevfik Bultan.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Casey O’Brien Java Tutor. Python Java Python 6.01 Java.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
WEB DESIGN SOME FOUNDATIONS. SO WHAT IS THIS INTERNET.
Windows Azure AppFabric Access Control Service (ACS) v.2 (Beta) Prerequisites.
Overview of HTML. Three Different Approaches  Text editor like Notepad  HTML editor such as: –KompoZer –DreamWeaver –Microsoft Expression Web –iWeb.
Technology Overview. Confidential & Proprietary Information System Unit Server Two-way Satellite network System includes units and server Units have built.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Intro to PHP Introduction to server-side scripts (It’s all good :D) © TAFE NSW
Databases and the Internet. Lecture Objectives Databases and the Internet Characteristics and Benefits of Internet Server-Side vs. Client-Side Special.
Server-side Scripting Powering the webs favourite services.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
SHINING WITH SHINY: INTRODUCING A WEB APPLICATION FRAMEWORK FOR R Gokul Bhandari.
Retail VMS(Vending Machine Management Solutions) Vending Machine Solution Provides that, where the management has to seek the information.
Implementation - Part 2 CPS 181s March 18, Pieces of the Site-building Puzzle Page 180, figure 4.1.
WEB SCIENCE. What is the difference between the Internet and the World Wide Web? Internet is the entire network of connected computers and routers used.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
C# AND ASP.NET What will I do in this course?. MAJOR TOPICS Learn to program in the C# language with the Visual Studio IDE (Interactive Development Environment)
Java Portals and Portlets Submitted By: Rashi Chopra CIS 764 Fall 2007 Rashi Chopra.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
CS1001 Lecture 9. Overview Security Security HTML HTML.
The HTTP is a standard that all Web browsers and Web servers must speak in order for the Web portion of the Internet to work.
Web application architecture1 Based on Jim Conallen: Web Applications with UML.
Amir Iqbal L Mahwish Khan L Rabia Akhtar L Nida Sarwar L Cloud Computing Based – Online IDE.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
Java for networking Module Introduction Data Communications Communication architecture Application.
 Computer is an electronic tool that can accept, process, and accumulate data which can produce a result or output.  Computer System is a combination.
Web Development Technologies Advanced Web-based Systems Advanced Web-based Systems | Misbhauddin.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
The basics of knowing the difference CLIENT VS. SERVER.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Portals, Services, Interfaces Marlon Pierce Indiana University March 15, 2002.
Computer Systems Lab TJHSST Senior Research Project Browser Based Distributed Computing Siggi Simonarson.
Random Logic l Forum.NET l ASP.NET performance Forum.NET 5 th Meeting ● March 2006 By Yaniv Sharon.
Albert F. Cervantes, M.S. California State University, Los Angeles
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
The Internet Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
VertexPlus Softwares Pvt. Ltd. WEB TECHNOLOGIES BEFORE CHOOSING WEBSITE DEVELOPMENT SERVICES FOR WEBSITE vertexplus.com.
Dive into web development
BRANDING YOURSELF FINAL DRAFT.
Internet/Web Databases
Chengyu Sun California State University, Los Angeles
Output files generation
Mobile applications Jouni Juntunen Oulu University of Applied Sciences
PHP / MySQL Introduction
EXTENSION AND INTEGRATION
Chengyu Sun California State University, Los Angeles
Unit 6 part 3 Test Javascript Test.
WPS - your story so far Seems incredible complicated, already
Chengyu Sun California State University, Los Angeles
Back end Development CS Programming Languages for Web Applications
Chengyu Sun California State University, Los Angeles
04 | Apps and SharePoint Chris Johnson | SharePoint Guru
Snippet Engine as a Database Server
Back end Development CS Programming Languages for Web Applications
Web Application Development Using PHP
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

BUILDING INTERACTIVE, R-POWERED WEB APPLICATIONS WITH SHINY Jeff Allen, Dallas R Users Group 2/9/2013

About Me  By day…  Computational Biologist at UT Southwestern Use R to analyze biomedical data Develop Java-based web application  By night…  Freelance consultant as Trestle Technology Web development Data analysis IT consulting  MS Computer Science, SMU

Overview  Motivation  Shiny  Reactive Programming  Code Walkthroughs  Simple histogram  Advanced histogram  Reactive histogram  Custom outputs  Hosting

Motivation “R is great!” “The Internet is great!”

Motivation  Want to get R into web browsers  Previous approaches  rApache  Rserve (Java, C++, C#, Python, Ruby,.NET)  deployR  Custom hacks  Just make R accessible to server-side programming languages (PHP, Ruby, Java, etc.)

Shiny  Open-Sourced by RStudio 11/2012 on CRAN  New model for web-accessible R code  Able to generate basic web UIs  Uses web sockets  “The new HTTP”  Built on a “Reactive Programming” model  Entirely extensible  Custom inputs and outputs

Reactive Programming a <- 3 b <- a + 2 a <- 7 b == ? Imperative: b = 5 Reactive: b = 9

Reactive Programming Example

Basic Shiny UI and Server Basic Shiny Example

ui.R shinyUI(bootstrapPage( selectInput(inputId = "n_breaks", label = "Number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), plotOutput(outputId = "main_plot", height = "300px"))

ui.R shinyUI(bootstrapPage( selectInput(inputId = "n_breaks", label = "Number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), plotOutput(outputId = "main_plot", height = "300px") ))

ui.R shinyUI(bootstrapPage( selectInput(inputId = "n_breaks", label = "Number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), plotOutput(outputId = "main_plot", height = "300px") ))

ui.R shinyUI(bootstrapPage( selectInput(inputId = "n_breaks", label = "Number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), plotOutput(outputId = "main_plot", height = "300px") ))

ui.R shinyUI(bootstrapPage( selectInput(inputId = "n_breaks", label = "Number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), plotOutput(outputId = "main_plot", height = "300px") ))

server.R shinyServer(function(input, output) { output$main_plot <- reactivePlot( function(){ hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks), xlab = "Duration (minutes)", main = "Geyser eruption duration") })

server.R shinyServer(function(input, output) { output$main_plot <- reactivePlot( function(){ hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks), xlab = "Duration (minutes)", main = "Geyser eruption duration") })

server.R shinyServer(function(input, output) { output$main_plot <- reactivePlot( function(){ hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks), xlab = "Duration (minutes)", main = "Geyser eruption duration") })

server.R shinyServer(function(input, output) { output$main_plot <- reactivePlot( function(){ hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks), xlab = "Duration (minutes)", main = "Geyser eruption duration") })

server.R shinyServer(function(input, output) { output$main_plot <- reactivePlot( function(){ hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks), xlab = "Duration (minutes)", main = "Geyser eruption duration") })

Key Dependency Graph – Simple shinyServer $n_breaks Reactive Function Input main_plot

Additional UI Features Intermediate Shiny Example

Key Dependency Graph – Naïve shinyServer $dataset $individual _obs $bw_adjust $n_breaks Reactive Function Input $density main_plot (Get data, get name, plot)

Key “Data Flow”– Naïve shinyServer $dataset $individual _obs $bw_adjust $n_breaks Reactive Function Input $density main_plot (Get data, get name, plot)

Optimized Reactive Server Reactive Shiny Example

Key Dependency Graph – Reactive getData dataName shinyServer $dataset $individual _obs $bw_adjust $n_breaks Reactive Function Input $density main_plot

Key “Data Flow” – Reactive getData dataName shinyServer $dataset $individual _obs $bw_adjust $n_breaks Reactive Function Input $density main_plot

D3.JS Shiny Example

RGL Shiny Example

Hosting  RStudio offers “Glimmer”  Free (for now) managed hosting platform for Shiny  RStudio‘s Shiny-Server  Open sourced 1/22/2013  Written in Node.js  Same software that powers Glimmer  “Some assembly required”  Hacks to support older IEs  Amazon Machine Image on EC2

Questions?  Code at   Slides at  Find me on: