title: replace different values in column using R
body: <p>I have a data frame with the character variable ID.  It has IDs with 9 digits and 3 other values: blank, N/A and NA.  I want to replace blank, N/A and NA with 999999999. </p>
  
  <p>I tried using this:</p>
  
  <pre><code>df$id &lt;- gsub('','999999999', df$id)
  </code></pre>
  
  <p>But it replaces all blanks (even with valid IDs).  What is the best way to do this?</p>
  
  <pre><code>id &lt;- c("", "N/A", "123456789", "NA","123456789")
  &gt; dummydata &lt;- data.frame(id)
  </code></pre>