[EMAIL PROTECTED] > One more question. After I collapse everything into one matrix, > I would like to find the index of column that holds minimum value for > each row. I remember that there is a function like maxCols but I can't > seem to find the same thing for minimum value. Any suggestion please?
Here is a possible avenue: > z <- matrix(sample(1:25), 5) > z [,1] [,2] [,3] [,4] [,5] [1,] 16 2 9 24 7 [2,] 21 19 22 23 18 [3,] 12 3 5 13 15 [4,] 20 4 25 11 10 [5,] 17 1 8 14 6 > apply(z, 2, which.min) [1] 3 5 3 4 5 I would presume (yet I did not recently check) that "do.call", "which.min", and a flurry of other useful functions, are introduced in various R tutorials. If you plan to use R seriously, it might be worth scrutinizing a few of those. Keep happy! -- François Pinard http://pinard.progiciels-bpi.ca ______________________________________________ R-help@stat.math.ethz.ch 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.