I hope this is what you want. ## Exclude replicated rows (DF1 <- unique(DF))
## Sort the data (DF2 <- DF1[order(DF1$V1, DF1$V2, DF1$V3, DF1$V4),]) ----- A R learner. -- View this message in context: http://r.789695.n4.nabble.com/How-to-extract-rows-from-data-frame-based-on-unique-variable-groupings-tp2225233p2225410.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.