Hi Gerrit, This does exactly what I want, thank you very much!
Even more, I notice that ave() uses the split/unsplit functions under the hood, which are very useful tools as they allow to apply even more complicated functions on a factor-by-factor basis. best, Vassilis -- View this message in context: http://r.789695.n4.nabble.com/Can-the-by-function-return-a-single-column-tp3089231p3089556.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.