Thank you Jim, it works very well. I do not need do it using tapply, but i think that it is the way. And Patrick thank you too -- View this message in context: http://r.789695.n4.nabble.com/help-with-tapply-or-other-apply-tp2122683p2122728.html Sent from the R help mailing list archive at Nabble.com.