Robert Mitchell | @robertmitchellv
2018-12-10
shiny
app can be interactiveshiny
app can look
flexdashboard
instead of shiny
shiny
framework, e.g., async
and how you can make it scale (things to think about for later)shiny
tutorial before but didn't finish it***T
shiny
application–writing code is hard and you should know it takes non-software engineers a while to wrap their minds around things like this
rmarkdown
report can be repurposed for another medium
flexdashboard
, which you should always use in the event a shiny
application is unnecessarily adding complexity to your work! (we'll talk about this more later)server
code to run
reactivity
n. reactivity is how we describe the way in which your shiny
application is able to respond to input and update output instantly.
In order for your application to be able to react in this way, it needs to know how to deal with values that will change. We call these reactive values.
shiny
application for now.shiny
installed, then first:install.packages("shiny")
library(shiny)
runExample("01_hello")
runExample()
runExample
[1] "01_hello" "02_text" "03_reactivity" "04_mpg"
[5] "05_sliders" "06_tabsets" "07_widgets" "08_html"
[9] "09_upload" "10_download" "11_timer"
shiny
seem difficult.shinydashboard
package (https://github.com/rstudio/shinydashboard)shinydashboard
UI will consist of the following three components
dashboardHeader()
dashboardSidebar()
dashboardBody()
library(shinydashboard)
dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody()
)
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody()
)
server <- function(input, output) { }
shinyApp(ui, server)
shinydashboard
!Let's return to some of the examples to see how this works.
shiny
works and employ the same strategies in creating a flexdashboard
, which doesn't require an R server to run!rmarkdown
to create dashboards that you can run without a server
shiny
aside to focus on flexdashboard
firstflexdashboards
can even use shiny
as a runtime, so you can really have the best of both world!
shiny
to do all of the reactive/interactive work, you can also use htmlwidgets
(https://github.com/ramnathv/htmlwidgets)
htmlwidgets
?plotly
can be an htmlwidget
leaflet
can be included as an htmlwidget
plotly
https://plot.ly/r/leaflet
https://rstudio.github.io/leaflet/shiny
has the ability to now help support these efforts using asynchronous operationsshiny
is capable and worth learning!shinydashboard
: https://rstudio.github.io/shinydashboard/get_started.html
shiny
development, and how it all works.