Skip to content

Instantly share code, notes, and snippets.

@ptoche
Last active January 2, 2016 13:49
Show Gist options
  • Save ptoche/8312791 to your computer and use it in GitHub Desktop.
Save ptoche/8312791 to your computer and use it in GitHub Desktop.
# global.R
c1 <- c("16681","16892","18586","18921","18923","19731","19775","20275","20965","22873")
c2 <- c("20267","24093","24095","25386","25359","25388","25396","25397")
# server.R
library("shiny")
shinyServer(
function(input, output, session) {
output$showPanel <- renderText({
out <- 1
if (input$SiteNo %in% c1) { out <- 1 }
else { out <- 0 }
return(out)
})
}
)
# ui.R
shinyUI(
pageWithSidebar(
headerPanel("Testing & Debugging")
,
sidebarPanel(
selectInput(
"SiteNo"
, "CenterID"
, c(c1,c2)
)
,
conditionalPanel(
condition = "output.showPanel == true"
, selectInput("WeekNo1", "Batch", c("1","34"))
)
,
conditionalPanel(
condition = "output.showPanel == false"
, selectInput("WeekNo2", "Batch", c("1","34","37"))
)
)
,
mainPanel( h4("Debug:"), textOutput("showPanel"))
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment