title: Use lapply to find if column names of various dataframes are the same
body: <p>I am trying to find out  if the column names in about 20 data frames are the same. The 20 data frames are held in a list (<code>Portfolio_snapshots</code>). Here is a sample set of data:</p>
  <pre><code>DF1 &lt;- data.frame(v1=rnorm(10),v2=LETTERS[1:5])
  DF2 &lt;- data.frame(v1=rnorm(10),v2=LETTERS[1:5])
  DF3 &lt;- data.frame(v1=rnorm(10),v3=LETTERS[1:5])
  Portfolio_snapshots &lt;- list(DF1,DF2,DF3)
  </code></pre>
  <p>I've tried this:</p>
  <pre><code>Df_names &lt;- lapply(Portfolio_snapshots, function(x) {
          names(as.data.table(x))})
  lapply(Df_names,function(x) {all.equal((Df_names[1]),(x))})
  </code></pre>
  <p>But it doesn't produce the right result . The code should ideally produce a <code>TRUE</code> for first two and a <code>FALSE</code> for the third.  Also if there is any way to show which are the column names where there is a mismatch,  then that would be an added bonus.</p>