Interactive reports and webpages with R & Shiny

OUHSC Statistical Computing User Group

Will Beasley, Dept of Pediatrics,

Biomedical and Behavioral Methodology Core (BBMC)

October 6, 2015

Overview of Shiny

R doesn't work well when called by a conventional website. RStudio's developers built the Shiny web framework that permits this integration.

  • Requires a UI (user interface) and server file.
  • Everything can be written in R. Shiny will create & translate to the necessary HTML5, JavaScript & CSS components. (But these can be written to create fancy reports.)
  • Can leverage almost all R capabilities.
  • Great official gallery, user examples, tutorials, and documentation, and presence in forums and StackOverflow.

Our Tipping Point

  • In 2012, our 8 data collectors need fresh reports every few hours; the report has stats, tables, & graphs, suggesting R.
  • Our previous best option was to install (a) R & knitr and (b) the report code on each laptop. Updates were required too.
  • Shiny avoids the deployment hassle. Our campus server contains the stat & reporting software. The data collectors need only a browser.
  • Many deployment scenarios have much more than 8 users, further suggesting Shiny.

Screen Shots

(Switch to the slides of screen shots.)

Concepts from Reactivity Example

http://shiny.rstudio.com/gallery/reactivity.html

  • Call chain (much more here).
  • Lazily evaluates terms ('lazy' is good here; it's efficient).
  • Watch the yellow highlights respond.

What's Available to You Through

  • shinyapps.io
  • Our public BBMC Shiny Server…
  • Our upcoming secured BBMC Shiny Server…
  • Our Shiny code & server installation scripts…

Immediate Influence & Assistance