title: fill data.frame by matching value with column name
body: <p>I have two data.frames:</p>
  
  <p><strong>df1</strong> (empty, but with specific colnames)</p>
  
  <pre><code>apple orange banana pear grape
  0      0       0       0     0
  </code></pre>
  
  <p><strong>df2</strong></p>
  
  <pre><code>fruit1  count1 fruit2 count2
  apple   2      pear   1
  grape  4      orange 2
  banana 1      NA     NA
  </code></pre>
  
  <p>this is the output I'd like:</p>
  
  <pre><code>apples oranges bananas pears grapes
  2      0       0       1     0
  0      2       0       0     4
  0      0       1       0     0
  </code></pre>
  
  <p>I've considered doing something along the lines of:</p>
  
  <pre><code>for f (in range(nrow(df2))){
    for (i in range(ncol(df1))){
       if(fruit1==columnName[i]){
           df1[f,i]&lt;-count1
           ect...
  </code></pre>
  
  <p>However, i'm dealing with a rather large dataset, and this doesn't seem like the right way to do it. </p>