shining with shiny: introducing a web application framework for r gokul bhandari

Post on 12-Jan-2016

215 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

SHINING WITH SHINY: INTRODUCING A WEB APPLICATION FRAMEWORK FOR R

Gokul Bhandari

What is Shiny? A web application framework for R developed

by Rstudio R is open source statistical programming

language Download R from r-project.org Download Rstudio (IDE) from rstudio.com R packages: shiny, shinyapps

Deployment of shiny

Two ways: Shiny Server and shinyapps Shiny server: Open source and Professional

versions Through shinyapps: https://www.shinyapps.io/ Free, Basic $39/month, standard $99/month,

Professional $299/month

Example of shiny app

Code: ui.R

Code: server.R

Building user-interface (minimum code)

Building user-interface

Building user-interface

Adding control widgets

Adding control widgets

Displaying reactive output Output dynamically computed every time an

input changes Inputs are given through widgets Code updates the recent values of widgets

Output (ui) & render (server) functions

Reactivity: Main points use an *Output function in the ui.R script to place reactive

objects in your Shiny app use a render* function in the server.R script to tell Shiny how to

build your objects surround R expressions by braces, { }, in each render* function save your render* expressions in the output list, with one entry

for each reactive object in your app. create reactivity by including an input value in

a render* expression

Shiny Layouts Sidebar Grid: Fluid Grid, Fixed Grid Tabsets Navlists Nabbar Pages Themes

Demonstration

https://gokul.shinyapps.io/AOLAnalyzer/ https://gokul.shinyapps.io/shinyDoc/stat1.

Rmd http://rpubs.com/gokul108

top related