title: How to make dplyr::filter from vector work in Shiny app
body: <p>I have the following Rmarkdown:</p>
  
  <pre><code>---
  title: "Untitled"
  runtime: shiny
  output: 
    flexdashboard::flex_dashboard:
      theme: bootstrap 
      orientation: columns
      vertical_layout: scroll
  ---
  
  ```{r setup, include=FALSE}
  library(flexdashboard)
  library(tidyverse)
  ```
  
  Column {data-width=650}
  -----------------------------------------------------------------------
  
  ```{r}
  
  sidebarPanel( textInput("flowers", "flower name(s)", "virginica, setosa") )
  mainPanel(
    renderPrint({
     flower_list &lt;- unlist(lapply(strsplit(input$flowers, ",")[[1]], tolower))
     dat &lt;- iris %&gt;% filter(Species %in% flower_list)
     unique(dat$Species)
    })
  
  
  
  )
  
  ```
  </code></pre>
  
  <p>Basically what it does is to take input from user and return list of
  names after filtering. But it seems that it doesn't work:</p>
  
  <p><a href="https://i.stack.imgur.com/wSQW1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wSQW1.jpg" alt="enter image description here"></a></p>
  
  <p>For example the main panel should return two values <code>virginia setosa</code>.
  What's the right way to do it?</p>
  
  <p>In console it works fine:</p>
  
  <p>
  <br/></p>
  
  <pre class="lang-r prettyprint-override"><code>library(dplyr)
  #&gt; 
  #&gt; Attaching package: 'dplyr'
  #&gt; The following objects are masked from 'package:stats':
  #&gt; 
  #&gt;     filter, lag
  #&gt; The following objects are masked from 'package:base':
  #&gt; 
  #&gt;     intersect, setdiff, setequal, union
  dat &lt;- iris %&gt;% 
    filter(Species %in% c("virginica","setosa"))
  unique(dat$Species)
  #&gt; [1] setosa    virginica
  #&gt; Levels: setosa versicolor virginica
  </code></pre>