title: Compare each value of a row to corresponding value in a vector
body: <p>I want to compare each value of a row of a data.frame to its corresponding value in a vector. Here is an example:</p>
  
  <pre><code>df1 &lt;- matrix(c(2,2,4,8,6,9,9,6,4), ncol = 3)
  df2 &lt;- c(5,4,6)
  
  &gt; df1
       [,1] [,2] [,3]
  [1,]    2    8    9
  [2,]    2    6    6
  [3,]    4    9    4
  
  &gt; df2
  [1] 5 4 6
  </code></pre>
  
  <p>The comparison would be, if a value in a row of df1 is smaller than its corresponding value in df2, so row1: 2 &lt; 5, 8 &lt; 5, 9 &lt; 5; row2: 2 &lt; 4, 6 &lt; 4, 6 &lt; 4; row3: 4 &lt; 6, 9 &lt; 6, 4 &lt; 6</p>
  
  <pre><code>&gt; result
       [,1]  [,2]  [,3]
  [1,] TRUE FALSE FALSE
  [2,] TRUE FALSE FALSE
  [3,] TRUE FALSE  TRUE
  </code></pre>
  
  <p>Is there any way to do this without use of a loop?</p>
  
  <p>Thanks lads!</p>