Hi All,
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.

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
}

Bests!
Allen Chiu

2014-08-26
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to