Why yes. If you keep reading the helpfile for merge, you come to this bit:

Value:

     A data frame.  The rows are by default lexicographically sorted on
     the common columns, but for ‘sort = FALSE’ are in an unspecified
     order.

sort=FALSE doesn't preserve your order; instead it gives you an
unspecified potentially random order.

Sarah

On Wed, Jan 27, 2010 at 5:13 PM, lol zino <lolz...@gmail.com> wrote:
> Hello,
>
[...]
>
> I am attempting to merge them using the following:
>
> mergeddata <- merge(data1,data2, by.x="index", by.y="index2", sort=FALSE)
>
> I want to preserve the order of data1 by setting sort=FALSE, however
> the output I get is:
>
[...]
>
> which has not preserved the order of data1, and also does not have a
> clear relationship to the order of data2 that I can see. I also tried
> converting both index fields from chars to ints and got the same
> result. Any ideas of what is going on here?
>
> ______
-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
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.

Reply via email to