title: Running multiple t tests through looping columns in R
body: <p>For this exercise I will look at the dataset, <code>iris</code>.  What I want to do is to run the t-test between the first column and columns 2, 3, and 4.  so in the end we have 4 results, <code>t.test(c1, c2)</code>, <code>t.test (c1, c3)</code>, <code>t.test(c1, c4)</code>, <code>t.test(c1, c5)</code>.  Here's what I have so far. I'm getting some values but I'm not sure if its the right ones.  </p>
  
  <pre><code>result &lt;- vector("list", 4)
  for (i in 1:4) {
      x = iris[ , 1]
      y = iris[ , i + 1]
      result[i] = t.test(x, y)$p.value
  }
  </code></pre>