0% found this document useful (0 votes)
838 views18 pages

Building Interactive, R-Powered Web Applications With Shiny: Jeff Allen, Dallas R Users Group

Jeff Allen presented on building interactive web applications with Shiny, RStudio's new package for making web applications with R. Shiny uses a reactive programming model where code automatically re-executes in response to input changes, keeping outputs synchronized. Allen demonstrated simple examples like histograms and more advanced examples using D3.js and RGL. He discussed hosting options for Shiny apps, including RStudio's free Glimmer hosting platform and instructions for self-hosting with Shiny Server or Amazon EC2.

Uploaded by

Dnyanesh Ambhore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
838 views18 pages

Building Interactive, R-Powered Web Applications With Shiny: Jeff Allen, Dallas R Users Group

Jeff Allen presented on building interactive web applications with Shiny, RStudio's new package for making web applications with R. Shiny uses a reactive programming model where code automatically re-executes in response to input changes, keeping outputs synchronized. Allen demonstrated simple examples like histograms and more advanced examples using D3.js and RGL. He discussed hosting options for Shiny apps, including RStudio's free Glimmer hosting platform and instructions for self-hosting with Shiny Server or Amazon EC2.

Uploaded by

Dnyanesh Ambhore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

BUILDING INTERACTIVE,

R-POWERED WEB
APPLICATIONS WITH SHINY
2/9/2013

Jeff Allen, Dallas R Users Group

About Me

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

Reactive Programming
a <- 3
b <- a + 2
a <- 7
b == ?

Imperative: b = 5
Reactive: b = 9

Reactive Programming Example

Basic Shiny Example


Basic Shiny UI and Server

Intermediate Shiny Example


Additional UI Features

Dependency Graph Nave


shinyServer
main_plot

$dataset

(Get data, get


name, plot)

$n_breaks
$bw_adjust

Key

Reactive
Function
$individual
_obs

$density

Input

Data Flow Nave


shinyServer
main_plot

$dataset

(Get data, get


name, plot)

$n_breaks
$bw_adjust

Key

Reactive
Function
$individual
_obs

$density

Input

Reactive Shiny Example


Optimized Reactive Server

Dependency Graph Reactive


shinyServer
main_plot

$n_breaks
$bw_adjust

getData
$dataset
dataName
$individual
_obs

$density

Key

Reactive
Function
Input

Data Flow Reactive


shinyServer
main_plot

$n_breaks
$bw_adjust

getData
$dataset
dataName
$individual
_obs

$density

Key

Reactive
Function
Input

D3.JS Shiny Example


http://trestletechnology.net:3838/grn/

RGL Shiny Example


http://trestletechnology.net:3838/rgl/

Hosting

RStudio offers Glimmer


Free

(for now) managed hosting platform for Shiny

RStudios 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

You might also like