title: Summarise a data frame according a second data frame
body: <p>I have two different data frame, say df1 and df2 as follows:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>df1 &lt;- read.table(text = " Class Head Group
  A1 12 1
  A2 11 2
  A3 10 1
  A4 9 2
  A5 10 1
  ", header = TRUE)
  
  df2 &lt;- read.table(text = " Temp1 Temp2 Temp3 Temp4 Temp5
  13 13 14 11 17
  13 8 19 14 15
  14 2 20 15 14
  15 7 9 19 9
  ", header = TRUE)</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to get frequencies in Temps given df1 for each class and Head. Temp1 corresponds to A1, Temp2 corresponds to A2 and so on. So, for example, 
  if I see a value&lt; 12 ( see Head for A1) in Temp1, I will count them. In Temp1 all values great than 12 in Head , so the No=0 for A1. For A2, you see 11 in df1, so I need 
  to look at Temp2 and I see 3 values (8,2,7) are less than than 11, so No=3 for A2 and so on... </p>
  
  <p>I want to get the following outcome:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Class Head No
  A1 12 0
  A2 11 3
  A3 10 1
  A4 9 0
  A5 19 1</code></pre>
  </div>
  </div>
  
  I tried map2, but I was unsuccessful as tibble columns were not consistent lengths. So I wonder if we could do it in R</p>