title: R: how to check if all columns in a data.frame are the same
body: <pre><code>&gt; df = data.frame(A = c(1, 2, 3), B = c(3, 2, 2), C = c(3, 2, 1)); df
    A B C
  1 1 3 3
  2 2 2 2
  3 3 2 1
  &gt; df2 = data.frame(A = c(1, 2, 3), B = c(1, 2, 3), C = c(1, 2, 3)); df2
    A B C
  1 1 1 1
  2 2 2 2
  3 3 3 3
  </code></pre>
  
  <p>I want to know if all the columns in my data.frame are the same. For <code>df</code>, it should be FALSE, whereas for <code>df2</code> it should be TRUE. </p>