title: Using shapiro.test on multiple columns in a data frame
body: <p>I have a dataframe (let's call it <code>df</code>), containing n=100 columns (<code>C1</code>, <code>C2</code>,..., <code>C100</code>) and 50 rows (<code>R1</code>, <code>R2</code>,...,<code>R50</code>). I tested all the column in the data frame to be sure they are numeric. I want to know if the data in each column has a normal distribution using the <code>shapiro.test()</code> function.</p>
  <p>I am able to do it column by colums using the code :</p>
  <pre><code>&gt; shapiro.test(df$Cn)
  </code></pre>
  <p>or</p>
  <pre><code>&gt; shapiro.test(df[,c(Cn)])
  </code></pre>
  <p>However, when I try to do it on several columns at the same time it doesn't work :</p>
  <pre><code>&gt; shapiro.test(df[,c(C1:C100)])
  </code></pre>
  <p>returns the error :</p>
  <blockquote>
  <p>Error in <code>[.data.frame</code>(x, complete.cases(x)) : undefined columns selected</p>
  </blockquote>
  <p>I would appreciate if anyone could suggest a way to do all the tests at the same time, and eventually storing the results in a new dataframe/matrix/list/vector.</p>