title: Check if a column in a dataframe is of the same value
body: <p>It is a follow-up question to <a href="https://stackoverflow.com/questions/15917824/checking-for-identical-columns-in-a-data-frame-in-r">this one</a>. What I would like to check is if any column in a data frame contain the same value (numerical or string) for all rows. For example,</p>
  
  <pre><code>sample &lt;- data.frame(col1=c(1, 1, 1), col2=c("a", "a", "a"), col3=c(12, 15, 22))
  </code></pre>
  
  <p>The purpose is to inspect each column in a data frame to see which column does not have identical entry for all rows. How to do this? In particular, there are both numbers as well as strings.</p>
  
  <p>My expected output would be a vector containing the column number which has non-identical entries.</p>