Create a gist now

Instantly share code, notes, and snippets.

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