dear Hadley and Bert, thank you very much for your suggestions. I asked one question and I learned 2 things:
1. Hadley, library(plyr) ddply(data, .(V1), colwise(cl)) that is exactly what I was searching for. 2. Bert, > ?tapply says that the first argument is an **atomic** vector. A > factor is not an atomic vector. So tapply interprets it as such by looking > only at its representation, which is as integer values. I admit I payed not enough attention to the definition of **atomic** vector. That implies a deeper understanding of structures of data. I'm working with! Many thanks, Patrizio ______________________________________________ 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.