title: Merging data frames in R: results not sorted.
body: <p>This is based on an example on <a href="https://stackoverflow.com/questions/8091303/simultaneously-merge-multiple-data-frames-in-a-list">Simultaneously merge multiple data.frames in a list</a> .
  I want to merge multiple data frames with a single column in common -- can do that with the example provided on the link. 
  But it seems that using the parameter <code>sort=TRUE</code> has no effect. Here is the short, reproducible code:</p>
  
  <pre><code>x &lt;- data.frame(i = c("m","b","c"), j = 1:3)
  y &lt;- data.frame(i = c("n","c","d"), k = 4:6)
  z &lt;- data.frame(i = c("o","d","a"), l = 7:9)
  </code></pre>
  
  <p>Merging all them <strong>without</strong> sorting:</p>
  
  <pre><code>Reduce(function(dtf1, dtf2) merge(dtf1, dtf2, by = "i", all = TRUE),
         list(x,y,z))
  </code></pre>
  
  <p>Gives me</p>
  
  <pre><code>  i  j  k  l
  1 b  2 NA NA
  2 c  3  5 NA
  3 m  1 NA NA
  4 d NA  6  8
  5 n NA  4 NA
  6 a NA NA  9
  7 o NA NA  7
  </code></pre>
  
  <p>Merging all them <strong>with</strong> sorting:</p>
  
  <pre><code>Reduce(function(dtf1, dtf2) merge(dtf1, dtf2, by = "i", all = TRUE,sort = TRUE),
         list(x,y,z))
  </code></pre>
  
  <p>Gives me the same result as above. I know I can sort the dataframe after the merging (I guess it could even be probably more efficient) but why <code>sort = TRUE</code> has no effect?</p>
  
  <p>I'm running R 3.4.3 under RStudio on a Mac. 
  Thanks
  Rafael</p>