SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
Shiny
Live / Shared / Explored
BARUG May 2013 Alex B Brown
Thursday, August 22, 13
Agenda
• Why Shiny?
• First steps in shiny - text and graphics
• Shiny and d3
• Resources
Thursday, August 22, 13
R today
) Excellent statistics platform
) Fabulous graphics
• A personal experience - not a shared one
( Graphics are typically static - manipulated
in code, not in the visualisation
( Too slow and memory hungry
( Single threaded
Thursday, August 22, 13
What’s Shiny?
• A Webserver for R
• Really simple - no httpd or JS knowledge
• A Functional Reactive system
• An application platform
• Addresses some of R’s limitations
Thursday, August 22, 13
Getting Started
• install.packages('shiny')
• Write your user interface in ui.R
• Write your application server.R
• runApp()
• Test / Debug / Enhance
• Share it with your team or the world
Thursday, August 22, 13
First Demo
library(shiny)
shinyUI(
	
  	
  textInput("who","Reviewed	
  by","nobody"),
	
  	
  selectInput("rating",	
  "Rating"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  c("Hard","Easy")),
	
  	
  h1(textOutput("review"))))
library(shiny)
shinyServer(function(input,	
  output)	
  {	
  
	
  	
  output$review	
  <-­‐	
  renderText({
	
  	
  	
  	
  paste(input$who,	
  
	
  	
  	
  	
  	
  	
  "thinks	
  shiny	
  is",	
  input$rating)
	
  	
  	
  	
  })
ui.R
server.R
always use library(shiny)
at the start of ui.R and
server.R
Thursday, August 22, 13
First Demo >	
  runApp()
Thursday, August 22, 13
First Demo
Thursday, August 22, 13
library(shiny)
shinyUI(
	
  	
  textInput("who","Reviewed	
  by","nobody"),
	
  	
  selectInput("rating",	
  "Rating"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  c("Hard","Easy")),
	
  	
  h1(textOutput("review"))))
library(shiny)
shinyServer(function(input,	
  output)	
  {	
  
	
  	
  output$review	
  <-­‐	
  renderText({
	
  	
  	
  	
  paste(input$who,	
  
	
  	
  	
  	
  	
  	
  "thinks	
  shiny	
  is",	
  input$review)
	
  	
  	
  	
  })
First Demoui.R
server.R
Thursday, August 22, 13
library(shiny)
shinyUI(
	
  	
  textInput("who","Reviewed	
  by","nobody"),
	
  	
  selectInput("rating",	
  "Rating"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  c("Hard","Easy")),
	
  	
  h1(textOutput("review"))))
library(shiny)
shinyServer(function(input,	
  output)	
  {	
  
	
  	
  output$review	
  <-­‐	
  renderText({
	
  	
  	
  	
  paste(input$who,	
  
	
  	
  	
  	
  	
  	
  "thinks	
  shiny	
  is",	
  input$review)
	
  	
  	
  	
  })
input$who
First Demoui.R
server.R
textInput("who","Reviewed	
  by","nobody")
Thursday, August 22, 13
library(shiny)
shinyUI(
	
  	
  textInput("who","Reviewed	
  by","nobody"),
	
  	
  selectInput("rating",	
  "Rating"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  c("Hard","Easy")),
	
  	
  h1(textOutput("review"))))
selectInput("rating",	
  "Rating"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  c("Hard","Easy"))
library(shiny)
shinyServer(function(input,	
  output)	
  {	
  
	
  	
  output$review	
  <-­‐	
  renderText({
	
  	
  	
  	
  paste(input$who,	
  
	
  	
  	
  	
  	
  	
  "thinks	
  shiny	
  is",	
  input$review)
	
  	
  	
  	
  })
First Demoui.R
server.R
input$rating
Thursday, August 22, 13
library(shiny)
shinyUI(
	
  	
  textInput("who","Reviewed	
  by","nobody"),
	
  	
  selectInput("rating",	
  "Rating"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  c("Hard","Easy")),
	
  	
  h1(textOutput("review"))))
library(shiny)
shinyServer(function(input,	
  output)	
  {	
  
	
  	
  output$review	
  <-­‐	
  renderText({
	
  	
  	
  	
  paste(input$who,	
  
	
  	
  	
  	
  	
  	
  "thinks	
  shiny	
  is",	
  input$review)
	
  	
  	
  	
  })
	
  	
  output$review	
  <-­‐	
  renderText({
	
  	
  	
  	
  paste(input$who,	
  
	
  	
  	
  	
  	
  	
  "thinks	
  shiny	
  is",	
  input$rating)
	
  	
  	
  	
  })
First Demoui.R
server.R
h1(textOutput("review"))
Thursday, August 22, 13
First Demo - Review
• html input “who” is linked to R input$who
• R output$review is linked to html #review
• updates re-evaluate code automatically
• no javascript knowledge required
• this is the Function Reactive Web-server at
work
Thursday, August 22, 13
First Plot
shinyUI(div(
	
  	
  numericInput("binwidth","Bin	
  width",1),
	
  	
  selectInput("measurement","Measurement",
c("mpg","hp")),
	
  	
  plotOutput("myplot")))
shinyServer(function(input,	
  output)	
  {	
  
	
  	
  output$myplot	
  <-­‐	
  renderPlot({
	
  print(ggplot(data=mtcars,
	
  	
  aes_string(x=input$measurement))+
	
  	
  geom_dotplot(binwidth=input$binwidth))	
  	
  	
  	
  
})})
ui.R
server.R
Here ggplot2 needs to be
‘required’ at the start of
server.R only.
Thursday, August 22, 13
First Plot >	
  runApp()
Thursday, August 22, 13
First Plot Review
• Shiny supports all R plot types via ‘PNG’
• renderPlot foo is linked to plotOutput #foo
• Anything can be parameterised - numbers,
strings, functions, columns, methods, code
• Enables powerful ‘exploration’ of design
parameters for you
• Enables final user to adjust parameters
Thursday, August 22, 13
Live, Shared, Explored
Shiny reports are
live because the R
is executed every:
session
user
input
...continuously
DEMO
Thursday, August 22, 13
Live, Shared, Explored
Your reports are shared because:
Your whole team can see the most recent
version of the report - just share the URL
Your whole team can get involved in the
analysis
You can save and share where you navigated to
(* extra work required)
Thursday, August 22, 13
Live, Shared, Explored
Using tabs to select between datasets, reports
and visualisation - each with custom inputs and
outputs, you can enable your team to make
new discoveries in the data you already have.
Tabs allow whole new sets of inputs and graphs
to appear - completely customised in R using
ReactiveUI
Thursday, August 22, 13
Examples - stocks
• http://glimmer.rstudio.com/winston/stocks/
Thursday, August 22, 13
Making it super-
interactive
• Shiny has built-in support for PNG output
• Cutting edge web graphs zoomable and
clickable - for this we need javascript
• Tools like d3 and googleVis enable this
• Various projects are working on integrating
shiny and (d3...) right now
Thursday, August 22, 13
d3 - http://d3js.org
• Javascript library by Mike Bostock of New
York Times
• Many, Many visualisation types
• detailed control over output
• Shiny integration (beta):
• http://ramnathv.github.io/rCharts/r2js/
• http://glimmer.rstudio.com/alexbbrown/
g3plot/
Thursday, August 22, 13
d3 examples
Thursday, August 22, 13
• Popular JS graphing library
• R package available
• Integration with Shiny (beta)
Google Chart Tools /
GoogleVis
http://lamages.blogspot.co.uk/2013/02/first-
steps-of-using-googlevis-on-shiny.html
Thursday, August 22, 13
http://lamages.blogspot.co.uk/2013/02/first-steps-of-using-
googlevis-on-shiny.html
Thursday, August 22, 13
Shiny Resources
• Homepage - http://www.rstudio.com/shiny/
• Tutorial - rstudio.github.io/shiny/tutorial/
• Group - groups.google.com/group/shiny-discuss
• Source - https://github.com/rstudio/shiny/
• Examples - http://ramnathv.github.io/shinyExamples/
Thursday, August 22, 13
Review
• Shiny is easy and powerful
• You can make your analyses Shared, Live,
Explorable
• It’s going to get more powerful - interactive
graphics like d3 are coming
• You can get support from the community
and RStudio
• Start coding - and show us what you can
achieve
Thursday, August 22, 13
Q&A
• End of presentation
Thursday, August 22, 13

Mais conteúdo relacionado

Mais procurados

Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...Paweł Żurowski
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPAndrew Rota
 
GDG Kuwait - Modern android development
GDG Kuwait - Modern android developmentGDG Kuwait - Modern android development
GDG Kuwait - Modern android developmentGDGKuwaitGoogleDevel
 
Angular Weekend
Angular WeekendAngular Weekend
Angular WeekendTroy Miles
 
Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Seiya Mizuno
 
Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2Ahmed Moawad
 
08. session 08 intoduction to javascript
08. session 08   intoduction to javascript08. session 08   intoduction to javascript
08. session 08 intoduction to javascriptPhúc Đỗ
 
Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Ahmed Moawad
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScriptCodemotion
 
React native-firebase startup-mtup
React native-firebase startup-mtupReact native-firebase startup-mtup
React native-firebase startup-mtupt k
 
Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...
Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...
Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...Raj Lal
 
ruby-on-rails-and-ember-cli
ruby-on-rails-and-ember-cliruby-on-rails-and-ember-cli
ruby-on-rails-and-ember-clijks8787
 
Home Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinHome Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinJorge Ortiz
 
OUG Ireland 2019 - building free, open-source, PL/SQL products in cloud
OUG Ireland 2019 - building free, open-source, PL/SQL products in cloudOUG Ireland 2019 - building free, open-source, PL/SQL products in cloud
OUG Ireland 2019 - building free, open-source, PL/SQL products in cloudJacek Gebal
 

Mais procurados (20)

Cocoa heads 09112017
Cocoa heads 09112017Cocoa heads 09112017
Cocoa heads 09112017
 
Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
GDG Kuwait - Modern android development
GDG Kuwait - Modern android developmentGDG Kuwait - Modern android development
GDG Kuwait - Modern android development
 
Graphql with Flamingo
Graphql with FlamingoGraphql with Flamingo
Graphql with Flamingo
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
 
Chapter 3 - part1
Chapter 3 - part1Chapter 3 - part1
Chapter 3 - part1
 
Angular Weekend
Angular WeekendAngular Weekend
Angular Weekend
 
Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams
 
Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2
 
08. session 08 intoduction to javascript
08. session 08   intoduction to javascript08. session 08   intoduction to javascript
08. session 08 intoduction to javascript
 
Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
 
React native-firebase startup-mtup
React native-firebase startup-mtupReact native-firebase startup-mtup
React native-firebase startup-mtup
 
Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...
Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...
Hybrid Application Development for Maemo N900 Device using Qt Webkit - Discov...
 
Flamingo Core Concepts
Flamingo Core ConceptsFlamingo Core Concepts
Flamingo Core Concepts
 
ruby-on-rails-and-ember-cli
ruby-on-rails-and-ember-cliruby-on-rails-and-ember-cli
ruby-on-rails-and-ember-cli
 
Home Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinHome Improvement: Architecture & Kotlin
Home Improvement: Architecture & Kotlin
 
React native tour
React native tourReact native tour
React native tour
 
OUG Ireland 2019 - building free, open-source, PL/SQL products in cloud
OUG Ireland 2019 - building free, open-source, PL/SQL products in cloudOUG Ireland 2019 - building free, open-source, PL/SQL products in cloud
OUG Ireland 2019 - building free, open-source, PL/SQL products in cloud
 

Semelhante a Shiny r, live shared and explored

Writing infinite scalability web applications with PHP and PostgreSQL
Writing infinite scalability web applications with PHP and PostgreSQLWriting infinite scalability web applications with PHP and PostgreSQL
Writing infinite scalability web applications with PHP and PostgreSQLGabriele Bartolini
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projectsVincent Terrasi
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP TestingRan Mizrahi
 
Introduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shinyanamarisaguedes
 
GR8Conf 2009: Groovy Usage Patterns by Dierk König
GR8Conf 2009: Groovy Usage Patterns by Dierk KönigGR8Conf 2009: Groovy Usage Patterns by Dierk König
GR8Conf 2009: Groovy Usage Patterns by Dierk KönigGR8Conf
 
Introduction to Android Development with Java
Introduction to Android Development with JavaIntroduction to Android Development with Java
Introduction to Android Development with JavaJim McKeeth
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsOWASP Kyiv
 
Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)YangJerng Hwa
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...Edge AI and Vision Alliance
 
Mockist vs. Classicists TDD
Mockist vs. Classicists TDDMockist vs. Classicists TDD
Mockist vs. Classicists TDDDavid Völkel
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSNicolas Embleton
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R projectWLOG Solutions
 
Everything You Should Know About the New Angular CLI
Everything You Should Know About the New Angular CLIEverything You Should Know About the New Angular CLI
Everything You Should Know About the New Angular CLIAmadou Sall
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App EngineVlad Filippov
 

Semelhante a Shiny r, live shared and explored (20)

Go react codelab
Go react codelabGo react codelab
Go react codelab
 
Writing infinite scalability web applications with PHP and PostgreSQL
Writing infinite scalability web applications with PHP and PostgreSQLWriting infinite scalability web applications with PHP and PostgreSQL
Writing infinite scalability web applications with PHP and PostgreSQL
 
Build web apps with R
Build web apps with RBuild web apps with R
Build web apps with R
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projects
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Intro to PHP Testing
Intro to PHP TestingIntro to PHP Testing
Intro to PHP Testing
 
Introduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shiny
 
GR8Conf 2009: Groovy Usage Patterns by Dierk König
GR8Conf 2009: Groovy Usage Patterns by Dierk KönigGR8Conf 2009: Groovy Usage Patterns by Dierk König
GR8Conf 2009: Groovy Usage Patterns by Dierk König
 
Introduction to Android Development with Java
Introduction to Android Development with JavaIntroduction to Android Development with Java
Introduction to Android Development with Java
 
Web futures
Web futuresWeb futures
Web futures
 
OpenSIPS Workshop
OpenSIPS WorkshopOpenSIPS Workshop
OpenSIPS Workshop
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tips
 
Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
Mockist vs. Classicists TDD
Mockist vs. Classicists TDDMockist vs. Classicists TDD
Mockist vs. Classicists TDD
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JS
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R project
 
Everything You Should Know About the New Angular CLI
Everything You Should Know About the New Angular CLIEverything You Should Know About the New Angular CLI
Everything You Should Know About the New Angular CLI
 
Node azure
Node azureNode azure
Node azure
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
 

Último

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Shiny r, live shared and explored

  • 1. Shiny Live / Shared / Explored BARUG May 2013 Alex B Brown Thursday, August 22, 13
  • 2. Agenda • Why Shiny? • First steps in shiny - text and graphics • Shiny and d3 • Resources Thursday, August 22, 13
  • 3. R today ) Excellent statistics platform ) Fabulous graphics • A personal experience - not a shared one ( Graphics are typically static - manipulated in code, not in the visualisation ( Too slow and memory hungry ( Single threaded Thursday, August 22, 13
  • 4. What’s Shiny? • A Webserver for R • Really simple - no httpd or JS knowledge • A Functional Reactive system • An application platform • Addresses some of R’s limitations Thursday, August 22, 13
  • 5. Getting Started • install.packages('shiny') • Write your user interface in ui.R • Write your application server.R • runApp() • Test / Debug / Enhance • Share it with your team or the world Thursday, August 22, 13
  • 6. First Demo library(shiny) shinyUI(    textInput("who","Reviewed  by","nobody"),    selectInput("rating",  "Rating"                            c("Hard","Easy")),    h1(textOutput("review")))) library(shiny) shinyServer(function(input,  output)  {      output$review  <-­‐  renderText({        paste(input$who,              "thinks  shiny  is",  input$rating)        }) ui.R server.R always use library(shiny) at the start of ui.R and server.R Thursday, August 22, 13
  • 7. First Demo >  runApp() Thursday, August 22, 13
  • 9. library(shiny) shinyUI(    textInput("who","Reviewed  by","nobody"),    selectInput("rating",  "Rating"                            c("Hard","Easy")),    h1(textOutput("review")))) library(shiny) shinyServer(function(input,  output)  {      output$review  <-­‐  renderText({        paste(input$who,              "thinks  shiny  is",  input$review)        }) First Demoui.R server.R Thursday, August 22, 13
  • 10. library(shiny) shinyUI(    textInput("who","Reviewed  by","nobody"),    selectInput("rating",  "Rating"                            c("Hard","Easy")),    h1(textOutput("review")))) library(shiny) shinyServer(function(input,  output)  {      output$review  <-­‐  renderText({        paste(input$who,              "thinks  shiny  is",  input$review)        }) input$who First Demoui.R server.R textInput("who","Reviewed  by","nobody") Thursday, August 22, 13
  • 11. library(shiny) shinyUI(    textInput("who","Reviewed  by","nobody"),    selectInput("rating",  "Rating"                            c("Hard","Easy")),    h1(textOutput("review")))) selectInput("rating",  "Rating"                        c("Hard","Easy")) library(shiny) shinyServer(function(input,  output)  {      output$review  <-­‐  renderText({        paste(input$who,              "thinks  shiny  is",  input$review)        }) First Demoui.R server.R input$rating Thursday, August 22, 13
  • 12. library(shiny) shinyUI(    textInput("who","Reviewed  by","nobody"),    selectInput("rating",  "Rating"                            c("Hard","Easy")),    h1(textOutput("review")))) library(shiny) shinyServer(function(input,  output)  {      output$review  <-­‐  renderText({        paste(input$who,              "thinks  shiny  is",  input$review)        })    output$review  <-­‐  renderText({        paste(input$who,              "thinks  shiny  is",  input$rating)        }) First Demoui.R server.R h1(textOutput("review")) Thursday, August 22, 13
  • 13. First Demo - Review • html input “who” is linked to R input$who • R output$review is linked to html #review • updates re-evaluate code automatically • no javascript knowledge required • this is the Function Reactive Web-server at work Thursday, August 22, 13
  • 14. First Plot shinyUI(div(    numericInput("binwidth","Bin  width",1),    selectInput("measurement","Measurement", c("mpg","hp")),    plotOutput("myplot"))) shinyServer(function(input,  output)  {      output$myplot  <-­‐  renderPlot({  print(ggplot(data=mtcars,    aes_string(x=input$measurement))+    geom_dotplot(binwidth=input$binwidth))         })}) ui.R server.R Here ggplot2 needs to be ‘required’ at the start of server.R only. Thursday, August 22, 13
  • 15. First Plot >  runApp() Thursday, August 22, 13
  • 16. First Plot Review • Shiny supports all R plot types via ‘PNG’ • renderPlot foo is linked to plotOutput #foo • Anything can be parameterised - numbers, strings, functions, columns, methods, code • Enables powerful ‘exploration’ of design parameters for you • Enables final user to adjust parameters Thursday, August 22, 13
  • 17. Live, Shared, Explored Shiny reports are live because the R is executed every: session user input ...continuously DEMO Thursday, August 22, 13
  • 18. Live, Shared, Explored Your reports are shared because: Your whole team can see the most recent version of the report - just share the URL Your whole team can get involved in the analysis You can save and share where you navigated to (* extra work required) Thursday, August 22, 13
  • 19. Live, Shared, Explored Using tabs to select between datasets, reports and visualisation - each with custom inputs and outputs, you can enable your team to make new discoveries in the data you already have. Tabs allow whole new sets of inputs and graphs to appear - completely customised in R using ReactiveUI Thursday, August 22, 13
  • 20. Examples - stocks • http://glimmer.rstudio.com/winston/stocks/ Thursday, August 22, 13
  • 21. Making it super- interactive • Shiny has built-in support for PNG output • Cutting edge web graphs zoomable and clickable - for this we need javascript • Tools like d3 and googleVis enable this • Various projects are working on integrating shiny and (d3...) right now Thursday, August 22, 13
  • 22. d3 - http://d3js.org • Javascript library by Mike Bostock of New York Times • Many, Many visualisation types • detailed control over output • Shiny integration (beta): • http://ramnathv.github.io/rCharts/r2js/ • http://glimmer.rstudio.com/alexbbrown/ g3plot/ Thursday, August 22, 13
  • 24. • Popular JS graphing library • R package available • Integration with Shiny (beta) Google Chart Tools / GoogleVis http://lamages.blogspot.co.uk/2013/02/first- steps-of-using-googlevis-on-shiny.html Thursday, August 22, 13
  • 26. Shiny Resources • Homepage - http://www.rstudio.com/shiny/ • Tutorial - rstudio.github.io/shiny/tutorial/ • Group - groups.google.com/group/shiny-discuss • Source - https://github.com/rstudio/shiny/ • Examples - http://ramnathv.github.io/shinyExamples/ Thursday, August 22, 13
  • 27. Review • Shiny is easy and powerful • You can make your analyses Shared, Live, Explorable • It’s going to get more powerful - interactive graphics like d3 are coming • You can get support from the community and RStudio • Start coding - and show us what you can achieve Thursday, August 22, 13
  • 28. Q&A • End of presentation Thursday, August 22, 13