Traversing t tests in R