Library dplyr to use arrange() for ordering, in the case. library(dplyr)
result.order <- arrange(result, d, version, a, b, c) dim(result.order) [1] 3000 5 head(result.order) d version a b c 1 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 2 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 3 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 4 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 5 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 6 -2.986456069 3 0.2236414154 0.004258038663 1.089406822 my.merge <- merge(myinfo, mydata, by="version") result2 <- my.merge[,c("d", "version", "a", "b", "c")] result2.order <- arrange(result2, d, version, a, b, c) dim(result2.order) [1] 3000 5 head(result2.order) d version a b c 1 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 2 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 3 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 4 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 5 -2.986456069 1 0.2236414154 0.004258038663 1.089406822 6 -2.986456069 3 0.2236414154 0.004258038663 1.089406822 all.equal(result.order, result2.order) [1] TRUE -- GG [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.