title: write function to count number of vowels in a string
body: <p>I was assigned the following homework question:</p>
  
  <blockquote>
    <p>Write a function that will take a string as input and return the number of vowels in that string as the
    output</p>
    
    <p>• Name the function get_vowel_count<br>
    • Make sure to document what the function does using comments in R</p>
  </blockquote>
  
  <p>But when I feed the function a given string, it spits out 0 vowels in the console when there are clearly vowels in the string I give (e.g. "John Doe" contains three vowels)</p>
  
  <p>I've changed the <code>if</code> statement a bit to better account for vowels, but I think the program will only count if the string is exactly an "a", "e", "i", etc. </p>
  
  <p>I'm not sure what syntax exists to say "contains" rather than "is equal to"</p>
  
  <pre><code>
  mystr &lt;- "John Doe"
  
  get_vowel_count &lt;- function(phrase) {
    counter &lt;- 0
    for (i in phrase) {
      if ((i == 'a') | (i == 'e') | (i == 'i') | (i == 'o') | (i == 'u')) {
        counter &lt;- counter + 1 
      }   
    }
    output &lt;- paste("Your phrase has", counter, "vowels in it!" )
    print(output)
  }
  
  get_vowel_count(mystr)
  
  </code></pre>
  
  <p>The output is displaying 0 vowels, where, the expected should say "Your phrase has 3 vowels in it!"</p>