title: How to do t.test (two samples) to rows of a dataframe using apply family function?
body: <p>How to do t.test  to rows (with two levels, or in other words, groups of samples) of a dataframe using apply family function? I have done that using function and loops. And my overall purpose is to calculate DE genes from two groups of miRNA microarray samples. And I know limma can do that, but it seems limma doesn't support paired t-test.</p>
  
  <pre><code>t.test.df=function(df,paired){
    df.t=c()
    for(i in 1:nrow(df)){
      df.t=rbind(df.t,unlist(t.test(df[i,grp1],df[i,grp2],paired=paired)))
    }
    rownames(df.t)=rownames(df)
    df.t
  }
  </code></pre>
  
  <p>Bests!
  Allen Chiu</p>