But i need for each id have two data. Like... > x id v1 V2 1 1 1 12 2 1 2 13 4 2 4 15 5 2 5 16 8 3 8 19 9 3 9 20 11 4 11 22 12 4 12 23 So should write sample( if sample id >2 ,2). I don't know how to write (if sample id >2). Thanks. -- View this message in context: http://r.789695.n4.nabble.com/sampling-tp3310184p3311253.html Sent from the R help mailing list archive at Nabble.com.