and something like that: dat[dat$ID == sample(unique(dat$ID), 3), 2] ?
I'm not sure about the ",2" maybe you need the full matrix ? ps: first time, i forgot the list ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html