title: Divide a Column based on two Data Frames in R
body: <p>Suppose I have two data frames, df and df2, that look like:</p>
  
  <blockquote>
    <p>df</p>
  </blockquote>
  
  <pre><code>        User    Lab    Score
           A      1021    12
           A      1022    10
           A      1024    15
           B      1021    9
           B      1022    9
           B      1023    14
           C      1024    10
  </code></pre>
  
  <p>df2</p>
  
  <pre><code>        Lab    Score
          1021    15
          1022    10
          1023    15
          1024    15
  </code></pre>
  
  <p>I want to divide the Score column in df by the Score column in df2, depending on the Lab. Therefore I want to end up with a data frame that looks like:</p>
  
  <pre><code>        User    Lab    Score
          A       1021   0.8
          A       1022   1.0
          A       1024   1.0
          B       1021   0.6
          B       1022   0.9
          B       1023   0.93
          C       1024   0.67
  </code></pre>
  
  <p>where 12/15 = 0.8, 10/10 = 1.0, 15/15 = 1.0,9/15 = 0.6, 9/10 = 0.9, 14/15 = 0.9333, 10/15 = 0.6667</p>