title: Display all the option values using selectInput() in R Shiny
body: <p>In my case, the options are states and instead of a group of check boxes, I have a selectInput drop down. I am triggering the logic by the means of a single check box in the UI.Now, what I want is, every time I click the box, all my states should be pre-selected in the drop down and the user input is required in case when the check box is not clicked.
  But unfortunately, irrespective of whether the user has clicked the check-box or not, the output is always what the user selects in the drop down i.e. the default "all states" are not populated as pre-selections.</p>
  
  <pre><code>Server.R -  
      observe({
      if(input$national&gt;0)
      {if (input$national %% 2 == 0){
          updateSelectInput(session,
                          "State",label = h4("Select any state"),                               
                          choices = list("NSW" = "NSW","Victoria" = "Victoria","SA" = "SA","Tasmania" = "Tasmania"),                                                                                                                                 
                          selected = c("NSW","Victoria","SA","Tasmania"),multiple = TRUE                                                          
                          )}
        else 
        {updateSelectInput(session,
                          "State",                                
                          label = h4("Select any state"),                               
                          choices = list("NSW" = "NSW","Victoria" = "Victoria","SA" = "SA","Tasmania" = "Tasmania"),                                                                                                                                 
                          selected = c(),multiple = TRUE                                                          
                            ) 
    }}
  }) 
  </code></pre>
  
  <p>Any help is much appreciated and many thanks in advance.</p>