Skip to content

Instantly share code, notes, and snippets.

@dkincaid
Created February 2, 2014 21:51
Show Gist options
  • Save dkincaid/8775464 to your computer and use it in GitHub Desktop.
Save dkincaid/8775464 to your computer and use it in GitHub Desktop.
Tycho data Shiny web app
library(shiny)
fileUrl <- url("http://s3.amazonaws.com/data-excursions/states_cases.Rda")
load(fileUrl)
diseases <- unique(as.character(states_cases$disease))
states <- unique(as.character(states_cases$state))
shinyServer(function(input, output) {
output$diseaseSelect <- renderUI({
selectInput("disease", "Disease", diseases)
})
output$textDisplay <- renderText({
paste0("You selected ", input$disease)
})
}
)
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("Tycho Data Exploration"),
sidebarPanel(
htmlOutput("diseaseSelect")
),
mainPanel(
textOutput("textDisplay")
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment