text: user2247: I have FPKM values for Normal(80 cases), Group1(135 cases), Group2(147 cases), and Group3(102 cases) for 160 genes (Groups were obtained by clustering tumor data). 
  I want to perform t-test (two-sided, unpaired, unequal variance) between Normal and Group1, Normal and Group2, and Normal and Group3 such that I get p.value for each gene.
  The t.test function in R returns single p.value and not gene-wise (I don't want to do t-test in Excel). 
  Which package/function should I use to do this in R?
  
  user77: You can simply apply() t.test() to your matrix. In general, though, I expect lmFit() from the limma package will be simpler to use.
  Here is an example with t.test():
  m = matrix(runif(100, max=c(rep(1, 50), rep(1.5, 50))), nrow=10) # make some data
  apply(m, 1, function(x) t.test(x[1:5], x[6:10])$p.value)
  
  Neither t.test() nor lmFit() should be expected to produce the same results as excel, since excel is inferior in every way and should never be relied upon for any statistical analysis (plus lmFit is doing something much much more complicated than a simple t-test).
  As an aside, FPKMs are highly problematic for use in statistics. If possible, I strongly encourage you to get either per-gene counts or per-gene estimated counts and to use those in limma or another differential expression package instead, as the results will be much more reliable. I presume, though, that you're using TCGA data, so you may be stuck with FPKMs.
  
original_text: 2247: <p>I have FPKM values for Normal(80 cases), Group1(135 cases), Group2(147 cases), and Group3(102 cases) for 160 genes (Groups were obtained by clustering tumor data). </p>
  
  <p>I want to perform t-test (two-sided, unpaired, unequal variance) between Normal and Group1, Normal and Group2, and Normal and Group3 such that I get p.value for each gene.<br>
  The t.test function in R returns single p.value and not gene-wise (I don't want to do t-test in Excel). </p>
  
  <p>Which package/function should I use to do this in R?</p>
   77: <p>You can simply <code>apply()</code> <code>t.test()</code> to your matrix. In general, though, I expect <code>lmFit()</code> from the <code>limma</code> package will be simpler to use.</p>
  
  <p>Here is an example with <code>t.test()</code>:</p>
  
  <pre><code>m = matrix(runif(100, max=c(rep(1, 50), rep(1.5, 50))), nrow=10) # make some data
  apply(m, 1, function(x) t.test(x[1:5], x[6:10])$p.value)
  </code></pre>
  
  <p>Neither <code>t.test()</code> nor <code>lmFit()</code> should be expected to produce the same results as excel, since excel is inferior in every way and should never be relied upon for any statistical analysis (plus <code>lmFit</code> is doing something much much more complicated than a simple t-test).</p>
  
  <p>As an aside, FPKMs are highly problematic for use in statistics. If possible, I strongly encourage you to get either per-gene counts or per-gene estimated counts and to use those in <code>limma</code> or another differential expression package instead, as the results will be much more reliable. I presume, though, that you're using TCGA data, so you may be stuck with FPKMs.</p>
  