title: How to change values that start with a certain letter to NA (in R)
body: <p>I have a data frame that I'm using called "fish".</p>
  
  <p>The data frame has 3 different variables. One of the variables is called "species".</p>
  
  <p>There are some species that start with the letter M. I want to change all the values of species that start with the letter M to be missing (NA) instead.</p>
  
  <p>I know how to change it to NA when you are doing the whole species name, but how do you do it for just species that START with the letter M?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>fish$species[fish$species=="^M_"] &lt;- NA
  </code></pre>
  
  <p>But this doesn't work. Can anyone help?</p>