title: how to show some widgets based on the selection from one widget in shiny app
body: <p>below is a shiny app to upload a rda or csv file.  What I need is only show the checkboxinput and radiobutton widgets only when  csv is selected as the file type in the selectinput. When rda is selected, do not show those widgets. </p>
  
  <pre><code>library(shiny)
  library(DT)
  
  ##---------------------------------------------------------------
  ## ui
  ##---------------------------------------------------------------
  
  ui &lt;- fluidPage(
  
      sidebarLayout(
          sidebarPanel(
  
                  # select a file type
                  selectInput('filetype', label = h5(strong('Please select a file type')),
                              choices = c('rda', 'csv'),
                              selected = 'rda'),
  
                  # Input: Select a file ----
                  fileInput("file1", "Choose a file",
                            multiple = TRUE,
                            accept = c("text/csv",
                                       "text/comma-separated-values,text/plain",
                                       ".csv")),
  
                  tags$hr(),
  
                  # Input: Checkbox if file has header ----
                  checkboxInput("header", "Header", TRUE),
  
                  # Input: Select separator ----
                  radioButtons("sep", "Separator",
                               choices = c(Comma = ",",
                                           Semicolon = ";",
                                           Tab = "\t"),
                               selected = ","),
  
  
                  # Input: Select quotes ----
                  radioButtons("quote", "Quote",
                               choices = c(None = "",
                                           "Double Quote" = '"',
                                           "Single Quote" = "'"),
                               selected = '"')
  
          ),
  
  
          #------------------------------Main Panel--------------------    
          mainPanel(
  
              DT::dataTableOutput("data.table")
  
          )
      )
  )
  
  
  ##---------------------------------------------------------------------
  # server 
  ##---------------------------------------------------------------------
  options(shiny.maxRequestSize=30*1024^2) 
  
  server &lt;- function(input, output, session) {
  
  
      dt &lt;- reactive ({
  
          if (input$filetype %in% 'rda') {
              load (input$file1$datapath)
              df  
          } else {
              read.csv(input$file1$datapath,
                       header = input$header,
                       sep = input$sep,
                       quote = input$quote)
          }
  
      })
  
      output$data.table &lt;- DT::renderDataTable({
          req(input$file1)
          DT::datatable(dt(),
                        options = list(orderClasses = TRUE,
                      lengthMenu = c(5, 10, 20), pageLength = 5))
      })
  
  }
  
  runApp(shinyApp(ui=ui, server=server))
  </code></pre>
  
  <p>Really appreciate it if anyone can help me with that. I have no clue how to achieve that. </p>