title: Combining mutate and filter functions
body: <p>I am a beginner when it comes to R language so sorry if I am duplicating a question btw I use tidyverse packages.</p>
  
  <p>My problem is at follows:
  I have a dataframe in which one column looks like that</p>
  
  <pre><code>pre_schwa
  IY0
  SH
  Z
  +1500 rows
  </code></pre>
  
  <p>Now I need to create a column(variable) which corresposnds to this specific column. I created four vectors:</p>
  
  <pre><code>vowels &lt;- c("AY1", "ER0", "IY0", "IY1", "UW2")
  sonorants &lt;- c("M","N", "R", "Y", "ZH", "W")
  fricatives &lt;- c("F", "S", "SH", "TH", "V", "Z")
  stops &lt;- c("B", "CH", "D", "G", "JH", "K", "P", "T")
  </code></pre>
  
  <p>Having this I want to create a column called sonority_grouped which would consist of four names(vowels, sonorants, fricatives, stops) depending what character is in the pre_schwa column so I want it to look like this</p>
  
  <pre><code>  pre_schwa              sonority_grouped
    SH                     fricatives
    ER0                    vowels
    B                      stops
    Z                      fricative
    +1500 rows
  </code></pre>
  
  <p>I tried combining <code>mutate()</code> and <code>filter()</code> functions by %>% but I suck at programming.
  Thank you for any reponse.</p>