title: recode Na and NaN values for specific rows based on column value
body: <p>I want to recode NA and NaN values for rows where a column value is X. Here is my data structure.</p>
  <pre><code>V1  V2  V3   V4  V5  
  1   4   9    15  A 
  2   12  12   3   B
  3  NaN  7    NA  X
  </code></pre>
  <p>I want to replace NaN and NA values to 999 where V5 = X</p>
  <pre><code>V1  V2  V3   V4  V5  
  1   4   9    15  A 
  2   12  12   3   B
  3  999  7   999  X
  </code></pre>
  <p>I used the code below, but it is not working</p>
  <pre><code>df2 &lt;- replace_na(df$V5 == &quot;X&quot;, 999)
  </code></pre>
  <p>Can someone help?</p>