It depends on how the data are arranged ##---------------------------------------------------- x<-matrix(c(1,2,3,2,8,2,4,5,6),nrow=3) y<-matrix(c(10,2,13,0,8,4,4.2,5.2,6.2),nrow=3)
q<-mapply(t.test,as.data.frame(x),as.data.frame(y)) q ## The ith column of q contain the results of applying t.test to ## the ith column of x and the jth column of y ##---------------------------------------------------- Since the t.test returns a list, you can wrap it in your own function if you want to process the data in an assembly line fashion. Continuing the previous example: my.t<-function(x,y,...) { c(t.test(x,y,...))[1:3] } q2<-mapply(my.t,as.data.frame(x),as.data.frame(y)) q2 Good luck! Christos Argyropoulos University of Pittsburgh Medical Center ______________________________________________ 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.