Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of columns in join() #40

Closed
jiho opened this issue May 2, 2011 · 0 comments
Closed

Order of columns in join() #40

jiho opened this issue May 2, 2011 · 0 comments

Comments

@jiho
Copy link
Contributor

jiho commented May 2, 2011

We agreed that the best order would be: common columns, x-only columns, y-only columns. Currently the order is determined by the direction of the join, not by the order of the arguments.

With

> d1 = data.frame(a=1:3, b=1:3)
> d2 = data.frame(a=1:4, c=1:4)
> d1
  a b
1 1 1
2 2 2
3 3 3
> d2
  a c
1 1 1
2 2 2
3 3 3
4 4 4

Current

> join(d1, d2, type="right")
Joining by: a
  a c  b
1 1 1  1
2 2 2  2
3 3 3  3
4 4 4 NA

Desired

> join(d1, d2, type="right")
Joining by: a
  a  b  c
1 1  1  1
2 2  2  2
3 3  3  3
4 4 NA  4
@hadley hadley closed this as completed in c6af661 Oct 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants