Dear all Could someone explain me why lapply(split(x,fac),mean) returns means per levels of fac for each column of x whereas lapply(split(x,fac),sum) does not return sums per level of fac and columns of x, but adds all columns together? Hence, how can I get sum to behave as mean in this instance? Thank you very much in advance E. Castella
______________________________________________ R-help@r-project.org 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.