Skip to content

Latest commit

 

History

History
97 lines (61 loc) · 1.57 KB

shiny.md

File metadata and controls

97 lines (61 loc) · 1.57 KB

Interactive apps with shiny

We will need

library("shiny")

The architecture of a shiny app

The overview figure below is based and makes reference to the written tutorial.

shiny app overview

Running the apps

## in ui.R
shinyUI(fluidPage(...))
## in server.R
shinyServer(function(input, ouput) {
    ...
})
runApp("app-dir")

Example apps

shiny-app1

shiny-app2

Single-file app

ui <- fluidPage(...)
server <- function(input, output) { ... }

app <- list(ui = ui, server = server)
runApp(app)

Sharing

  • Share the code file(s) and runApp
  • runUrl
  • runGitHub
  • runGist
  • shinyapps
  • Shiny server

Exercise

Read and understand the code of the apps above and run them locally. Then, try to update them to replace of add some widgets.

More interactivity

 plotOutput("pca",
            hover = "hover",
            click = "click",
            dblclick = "dblClick",
            brush = brushOpts(
                id = "brush",
                resetOnNew = TRUE))

Example here.

Shiny apps

Push your shiny apps online with shinyapps.

References