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() with type = "left" fails if order of common variables is not equal in each data frame #16

Closed
gavinsimpson opened this issue Nov 4, 2016 · 0 comments
Assignees
Labels

Comments

@gavinsimpson
Copy link
Owner

Richard Telford reports the following bug:

spp <- data.frame(cat = 1:2, dog = 2:3, fish = 3:4)
fos <- data.frame(mouse = 7:8,dog = 9:10, cat = 5:6)

library("analogue")

join(spp, fos, type = "outer")#works
join(spp, fos, type = "left") #fails - dog and cat entries are switched

Notice that cat in fos in the join()ed output is c(9,10) but is c(5,6) upon input

> join(spp, fos, type = "left")
$spp
  cat dog fish
1   1   2    3
2   2   3    4

$fos
  cat dog fish
1   9   5    0
2  10   6    0

attr(,"class")
[1] "join"
attr(,"type")
[1] "left"
> fos
  mouse dog cat
1     7   9   5
2     8  10   6
@gavinsimpson gavinsimpson self-assigned this Nov 4, 2016
gavinsimpson added a commit that referenced this issue Jun 21, 2017
gavinsimpson added a commit that referenced this issue Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant