Oops, that should have been result[[1]], not results[[1]] On 17 September 2010 15:03, Michael Bedward <michael.bedw...@gmail.com> wrote: > Hello Selthy, > > Here's one way. Assume your tables are called x.trt and x.cont > > # form a single matrix > x <- cbind(x.trt, x.cont) > colnames(x) <- c("Ntrt", "BPtrt", "Ncon", "BPcon") > result <- apply( x, 1, function(xrow) fisher.test( matrix(xrow, nrow=2) ) ) > > Now result is a list where element i holds the test results for row i > of your data. E.g. to get the results for row 1.. > > results[[1]] > > Michael
______________________________________________ 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.