Re: [R] unexpected sort order with merge

2011-04-07 Thread Johann Hibschman
B77S writes: > That is odd, I noticed some weird sorting with merge() a while back too and > always am careful with it now. Fortunately, sort=FALSE seems to work the > way one would think most of the time. Thanks for checking. Is this on a more recent version of R than 2.10.1? (I'm half-hoping

Re: [R] unexpected sort order with merge

2011-04-06 Thread B77S
That is odd, I noticed some weird sorting with merge() a while back too and always am careful with it now. Fortunately, sort=FALSE seems to work the way one would think most of the time. Although, the following results seem weird too! (adding by="date" makes it not sort oddly, regardless of so

[R] unexpected sort order with merge

2011-04-06 Thread Johann Hibschman
`merge` lists sorted as if by character, not by the actual class of the by-columns. > tmp <- merge(data.frame(f=ordered(c("a","b","b","a","b"), levels=c("b","a")), x=1:5), data.frame(f=ordered(c("a","b"),