R Shiny EPID 799C Fall 2017
Today: Examples & Patterns Intro to Shiny Basics Dashboards Hands on Default app Births app Apps I’m working on R in other pathways (Javascript / D3)
But first! Web apps the usual way HTML/XML Javascript (D3, special APIs) CSS Prep work in multiple other languages / applications (ArcGIS, inkscape / photoshop, etc.) ^ Note: this is what “real” web folks ($$$ NYT) are currently doing, for the most part. Let’s look at an example: my final (WIP) project due next week. :/ www.unc.edu/~fliss/INLS641/project/
Why it’s hard Data and server setup can be annoying Building histograms by hand is no fun Requires multiple languages
Shiny Basics
Shiny Basics
Shiny Basics
Shiny Basics
Shiny Basics: Even More Widgets http://gallery.htmlwidgets.org/
Shiny Basics
Shiny Basics UI Can also directly write HTML (as functions) if you want to for max flexibility. Handles javascript and css too. Layouts: Base has layout tools, dashboard has some more.
Shiny Basics: Where to start? https://shiny.rstudio.com/gallery/ Gallery Start Simple for a great place to start. Also multiple tutorials (of course!) online.
Improving Shiny: Dashboards with flexdashboard and shinydashboard Comparison of two options: flexdashboard shinydashboard* R Markdown Shiny UI code Super easy Not quite as easy Static or dynamic Dynamic CSS flexbox layout Bootstrap grid layout *What I use https://shiny.rstudio.com/articles/dashboards.html
RMarkdown flexdashboards http://rmarkdown.rstudio.com/flexdashboard/index.html
A CDC example https://gallery.shinyapps.io/CDCPlot/
Shiny Gadgets Lives inside R Studio as an AddIn Helps you do your analysis Design your own buttons! Written in shiny app/server syntax
Shinyapps.io Free or very cheap server space Integrates seamlessly with Rstudio Upload your completed apps with a click
Let’s Try! Default Shiny App Births shiny app Fancier apps (WIP) https://mikedolanfliss.shinyapps.io/NCDETECT_Prototype/ https://injuryfreenc.shinyapps.io/OpioidActionPlan/ D3/Javascript www.unc.edu/~fliss/INLS641/project/