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 issue: column rename / column check function lost when 'by=' is assigned #655

Closed
happyshows opened this issue Oct 3, 2014 · 0 comments
Closed
Assignees
Labels

Comments

@happyshows
Copy link

@happyshows happyshows commented Oct 3, 2014

I realized there is an issue if I try to merge two datasets when x in dataset a joins z in dataset b, and dataset b happens to have a column named x too.
dataset should not be allowed to have two identical column names as I understand, and currently I am feeding the result to shiny renderDataTable and it's creating a few troubles.
I wish the join function will detect such names and rename the 2nd x as b.x

a <- data.frame(x=1:10,y=2:11)
b <- data.frame(x=5:14,y=3:12)
left_join(a,b,by=c('x'))
     x y.x y.y
 1   1   2  NA
 2   2   3  NA
 3   3   4  NA
 4   4   5  NA
 5   5   6   3
 6   6   7   4
 7   7   8   5
 8   8   9   6
 9   9  10   7
 10 10  11   8
b <- data.frame(z=5:14,x=3:12)
left_join(a,b,by=c('x'='z'))
     x  y  x
 1   1  2 NA
 2   2  3 NA
 3   3  4 NA
 4   4  5 NA
 5   5  6  3
 6   6  7  4
 7   7  8  5
 8   8  9  6
 9   9 10  7
 10 10 11  8
@romainfrancois romainfrancois self-assigned this Oct 3, 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