title: select multiple columns by checkboxGroupInput in R shiny
body: <p>I have a question about how to select multiple columns in my dataset by checkboxGroupInput in R shiny.</p>
  
  <p>Now my dataset have a column like this: (the pattern is stateName/number/number)</p>
  
  <p>IndividualName</p>
  
  <p>SA/111111/222222</p>
  
  <p>VIC/33333/444444</p>
  
  <p>NSW/55555/666666</p>
  
  <p>QLD/777777/888888</p>
  
  <p>.....</p>
  
  <p>and I have a select box that works well. I use grepl to extract state name and I can choose individual state successfully. </p>
  
  <p>UI:</p>
  
  <pre><code>        selectInput("select_state", h3("Select State"),
                  choices = list("All States"="SA|VIC|NSW|QLD|WA|TAS|NT|ACT|CTH","South Australia"="SA",
                                 "Victoria"="VIC","New South Wales"="NSW","Queensland"="QLD",
                                 "Western Australia"="WA","Northern Territory"="NT","Tasmania"="TAS",
                                 "Australian Capital Territory"="ACT","Commonwealth"="CTH")),
  </code></pre>
  
  <p>Server:</p>
  
  <pre><code>entities_state &lt;- entities[ with(entities, grepl(input$select_state, c(entities$IndividualName))), ]
  </code></pre>
  
  <p>Now I want to change the select box to checkbox group, I know to use checkbox group, we can write</p>
  
  <pre><code>entities_state &lt;-filter(entities, IndividualName %in% input$select_state)
  </code></pre>
  
  <p>but I still need extract stateName keyword from the "IndividualName" column. I don't know how to combine grepl, filter, and %n% to make the checkbox group work. </p>
  
  <p>I hope I express my problem clearly. If not, please let me know. </p>