title: Shiny App checkboxInput and conditionalPanel
body: <p>I am new to ShinyApp.</p>
  
  <p>I want to use a checkboxInput() with conditionalPanel, so when it's checked, the options for Type will show up (then users can select a Type from "BEER", "REFRESHMENT", "SPIRITS", "WINE"). If it's not checked, the options for Type will not show up. </p>
  
  <p>Below are my code, but when the Type options didn't show no matter I check the box or not. I guess I should write something in the server function? I really don't know. Thank you for your help.</p>
  
  <pre><code>  ui &lt;- fluidPage(
          titlePanel("BC Liquor Store prices"),
          img(src = "BCLS.png",align = "right"),
          sidebarLayout(
               sidebarPanel(sliderInput("priceInput", "Price", 0, 100, c(25, 40), pre = "$"),
  
              wellPanel(
              checkboxInput("checkbox", "Filter by Type", FALSE),
              conditionalPanel(
                condition="checkbox==true",   
               selectInput("typeInput", "Product type",
                            choices = c("BEER", "REFRESHMENT", "SPIRITS", "WINE"),
                            selected = "WINE")
            )
          ),
  
               uiOutput("countryOutput")
  
  ),
  mainPanel(
    tabsetPanel(
      tabPanel("Plot", plotOutput("coolplot")), 
      tabPanel("Summary", verbatimTextOutput("summary")), 
      tabPanel("Table", tableOutput("results"))
     )
    )
   )
  )
  
  server &lt;- function(input, output, session) {
        output$countryOutput &lt;- renderUI({
        selectInput("countryInput", "Country",
              sort(unique(bcl$Country)),
              selected = "CANADA")
    })  
  
       filtered &lt;- reactive({
          if (is.null(input$countryInput)) {
          return(NULL)
  }    
  
  bcl %&gt;%
    filter(Price &gt;= input$priceInput[1],
           Price &lt;= input$priceInput[2],
           Type == input$typeInput,
           Country == input$countryInput
    )
  })
  
       output$coolplot &lt;- renderPlot({
           if (is.null(filtered())) {
           return()
        }
       filtered() %&gt;% ggvis(~Alcohol_Content, fill := "#fff8dc") %&gt;% 
          layer_histograms(width = 1, center = 0)
     })
  
   output$results &lt;- renderTable({
  filtered()
   })
  }
  </code></pre>