Hi everybody, Thank you all for your suggestions, you have been very helpful. However at the end I solved in this way:
mysample <- MaxDH[sample(1:nrow(MaxDH), 150, replace=FALSE),] A<-mysample[1:120,] B<-mysample[121:150,] So simple at the end... Best, Luca -- View this message in context: http://r.789695.n4.nabble.com/Sampling-problems-tp4453752p4456469.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.