mat <- cbind(a=letters[1:6], b=paste(rep(c("b","B"), each=3), 1:3), c=rep(1,6),
d=gl(3,2), e=rep(c("e","E"),3), f=paste(rep(c("F","f","ff"), each=2), 1:2))
chooseGroupNames(mat, method="median") # col 2 (b/B)
chooseGroupNames(mat, method="median", fullReport=TRUE)
chooseGroupNames(mat, method="min") # col 2 (b/B)
chooseGroupNames(mat, method="max") # col 6 (F/f/ff)
chooseGroupNames(mat, method="max", asUnique=FALSE) # col 1 (a..)
Run the code above in your browser using DataLab