title: Invalid factor level, NA generated warning
body: <p>Similar to another question asked on here, I get the error message in the subject line.  I attempted to use it's remedy to fix my problem but I was not able to do so.  Here is my code:</p>
  
  <pre><code>#Change the format of IED deaths to be uniform
  USdata$Cause[USdata$Cause=="Hostile - hostile fire - IED attack" | USdata$Cause=="Hostile - hostile fire - IED attack (suicide attack)" | USdata$Cause=="Hostile - hostile fire - IED attack (suicide car bomb)" | USdata$Cause=="Hostile - hostile fire - IED attack (while defusing)" | USdata$Cause=="Hostile - hostile fire - IED attack, RPG" | USdata$Cause=="Hostile - hostile fire - IED attack, RPG, small arms fire" | USdata$Cause=="Hostile - hostile fire - IED Attack, small arms fire" | USdata$Cause=="Hostile - hostile fire - IED Attack, small arms fire, indirect fire"] &lt;- "Hostile - IED Attack"
  
  Warning message:
  In `[&lt;-.factor`(`*tmp*`, USdata$Cause == "Hostile - hostile fire - IED attack" |  :
   invalid factor level, NA generated
  </code></pre>
  
  <p>I see when I do a summary of my attempted new value, "Hostile - IED Attack", I get everything returned as NA's.  I was able to do something similar with other values but this one isn't working so easily.  Thanks.</p>