title: copy source to destination if destination is n/a
body: <p>I have this simple data frame:</p>
  
  <pre><code>&gt; dframe = data.frame(a=c(1,2,NA), b=c(11,NA,33))
  &gt; dframe
     a  b
  1  1 11
  2  2 NA
  3 NA 33
  </code></pre>
  
  <p>My goal is to copy <code>a</code> to <code>b</code> for each row but, only if <code>b</code> is <code>NA</code>. So my final data should be this:</p>
  
  <pre><code>&gt; dframe
     a  b
  1  1 11
  2  2 2
  3 NA 33
  </code></pre>
  
  <p>I've tried this but it gives me an error:</p>
  
  <pre><code>&gt; dframe[is.na(dframe$b), "b"] &lt;- dframe[!is.na(dframe$a), "a"]
  Error in `[&lt;-.data.frame`(`*tmp*`, is.na(dframe$b), "b", value = c(1,  : 
    replacement has 2 rows, data has 1
  </code></pre>