## 1000 variables, hence 1000 t-tests will be performed
x = matrix( rnorm(100 * 1000), ncol = 1000 )
## 100 observations in total
ina = rbinom(100, 1, 0.6) + 1 ## independent samples t-test
system.time( ttests(x, ina = ina) )
x1 = x[ina == 1, ]
x2 = x[ina == 2, ]
system.time( ttests(x1, x2) )
ina = rep(1:2, each = 50) ## dependent samples t-test
system.time( ttests(x, ina = ina, paired = TRUE) )
Run the code above in your browser using DataLab