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

Join on different variable names requires names for ALL variables #682

Closed
gvfarns opened this issue Oct 10, 2014 · 1 comment
Closed

Join on different variable names requires names for ALL variables #682

gvfarns opened this issue Oct 10, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@gvfarns
Copy link

@gvfarns gvfarns commented Oct 10, 2014

The new ability of the *_join() commands to join on variables with different names in the two datasets currently requires that every variable be named. Intuitively, it would seem like naming only those variables that actually have different names in the two datasets would be sufficient.

For example, the second case here:

> A <- data.frame(ID=c(1,1,2),strategy=c("a","b","b"),V1=c(45,34,23))
> B <- data.frame(Manager=c(2,3),strategy=c("b","a"),V2=c(11,22))
> left_join(A,B,by=c("ID"="Manager","strategy"="strategy"))
  ID strategy V1 V2
1  1        a 45 NA
2  1        b 34 NA
3  2        b 23 11
> left_join(A,B,by=c("ID"="Manager","strategy"))
Error: cannot join on columns 'strategy' x '' : index out of bounds

In this example I think it shouldn't be necessary for the user to write "strategy" twice when specifying that we should join on strategy.

@hadley
Copy link
Member

@hadley hadley commented Oct 11, 2014

Good idea!

@hadley hadley added the feature label Oct 30, 2014
@hadley hadley added this to the 0.3.1 milestone Oct 30, 2014
@hadley hadley self-assigned this Oct 30, 2014
@hadley hadley closed this in 06f7cc8 Nov 19, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants