I have four outputs (W, X, Y, and Z) in the form of data frame with common column (a, b, c) but having other different other columns. How can I merge them considering the order of each value of each dataframe. I have used the following syntax, and I could able to merge them but it hasn't given me in ascending order of each value, rather it gives me in random order.
Output <- Reduce(function(...) merge(..., by = c("a", "b", "c"), all=TRUE), list (W,X,Y, Z), accumulate = FALSE)
This produces the merged data but in unorderly manner and how could I adjust it to give in ascending order of the values in each dataframe? How can I get in order of a like 1, 3, 5, 9,..... (ascending values) with the corresponding value of all other parameters.
Sample data:
a b c Int R Sl P D
1 1 1 0.32
1 1 2 0.52
........................
3 1 1 1.56 0.23 0.36 0.455 0.52
-----------------------------------
9 1 1 0.526 0.46 0.56 0.566 0.322
.........................................
5 1 1 0.89 0.36 0.56 0.666 0.5222
............................................