title: calculating weighted sum of two columns with weights as two other columns
body: <p>consider the following dataset including NAs</p>
  
  <pre><code>df &lt;- data.frame(x1=c(3, 6, 9, NA),
                   w1=c(0.25, 1, 0.90, 0),
                   x2=c(2, NA, 4, 8),
                   w2=c(0.75, 0, 0.10, 1))
  </code></pre>
  
  <p>I would like to calculate a new column as <code>weighted_sum=x1.w1 + x2.w2</code> with <code>dplyr</code>, <code>mutate</code>  and <code>weighted.mean</code> but I do not have any idea how to set variables and weights and I could not find exact this issue under other quastions. The result should be like as following and NAs should not be regarded in sum.</p>
  
  <pre><code>  x1   w1   x2   w2 weighted_sum
    3    0.25  2 0.75         2.25
    6    1.00 NA 0.00         6.00
    9    0.90  4 0.10         8.50
    NA   0.00  8 1.00         8.00
  </code></pre>
  
  <p>Thankfull for any help!</p>