I have three data.frame objects, where I did combine them and also remove duplicated instances, but seems order is not good enough, I want to sort them in natural order. How can make this happen more efficiently?
toy data
foo <- data.frame( start=seq(1, by=4, len=6), stop=seq(3, by=4, len=6))
bar <- data.frame(start=seq(5, by=2, len=7), stop=seq(7, by=2, len=7))
bleh <- data.frame(start=seq(1, by=5, len=5), stop=seq(3, by=5, len=5))
I did combine them as follows:
out <- rbind.data.frame(foo, bar, bleh)
out <- out[!duplicated(out),]
but out doesn't have right order, I want to sort them in correct order by row.
desired output: (manually pin out)
start stop
1 1 3
2 5 7
3 6 8
4 7 9
5 9 11
6 11 13
7 13 15
8 15 17
9 16 18
10 17 19
11 21 23
how can I get my desired output format? Thanks a lot