Gabor Grothendieck wrote: > Convert dat to a matrix and see if working with the > matrix instead of a data frame speeds things up > enough. In the Hmisc package the asNumericMatrix and matrix2dataFrame functions facilite this. Also look at the summarize and mApply functions in Hmisc, which can be quite fast. Frank Harrell