## Not run:
# ## A simple example for a custom test function using a linear model.
# ## Note that for two groups this is equivalent to a t-test with equal variances.
# testFcn <- function(exprs, groups, id, index, testArgs) {
#
# stat <- function(e, g, f) {
# m <- lm(f)
# pval <- summary(m)$coefficients[2,4]
# }
#
# pvals <- apply(exprs[id,index], 1, stat, groups, testArgs$f)
# return(pvals)
# }
#
# ## Pass the definition of the linear model through 'testArgs'
# f <- formula(e ~ g)
#
# res <- gsri(exprs, groups, test=testFcn, testArgs=list(f=f))
# ## End(Not run)
Run the code above in your browser using DataLab