Thank you , this works but I have to do it with nested for loops... Could you suggest me a way ? -- View this message in context: http://r.789695.n4.nabble.com/nested-for-loops-tp3992089p3992324.html Sent from the R help mailing list archive at Nabble.com.