You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having problems with inner_join not working as expected. For some reason the data.frame ordering matters.
This does not work (tmp1 only has 1 row):
foo <- data.frame(x = "a", y = as.numeric(-10:10))
foo$var1 <- runif(nrow(foo))
bar <- data.frame(x = c(rep("b", 20), rep("a", 20)), y = as.integer(-10:9))
bar$var2 <- runif(nrow(bar))
tmp1 <- inner_join(foo, bar, by=c("x", "y"))
tmp2 <- inner_join(bar, foo, by=c("x", "y"))
This does work (the only difference is how bar is sorted):
foo <- data.table(x = "a", y = as.numeric(-10:10))
foo$var1 <- runif(nrow(foo))
bar <- data.frame(x = c(rep("a", 20), rep("b", 20)), y = as.integer(-10:9))
bar$var2 <- runif(nrow(bar))
tmp1 <- inner_join(foo, bar, by=c("x", "y"))
tmp2 <- inner_join(bar, foo, by=c("x", "y"))
I apologize for double posting (I originally wrote this under issue #326). I realized after posting that this probably should be its own issue and it's presumptuous to assume that the feature is the cause of the behavior.
The text was updated successfully, but these errors were encountered:
When the smaller data.frame is on the left, the answer is as we expect. When the smaller data.frame is on the right, we get the wrong answer. Perhaps this points to issue #326 as the culprit.
Note: this example fails to reproduce the error if the by variable "id" is of the same type (foo$id is integer, bar$id is numeric)
I'm having problems with inner_join not working as expected. For some reason the data.frame ordering matters.
This does not work (tmp1 only has 1 row):
This does work (the only difference is how
bar
is sorted):I apologize for double posting (I originally wrote this under issue #326). I realized after posting that this probably should be its own issue and it's presumptuous to assume that the feature is the cause of the behavior.
The text was updated successfully, but these errors were encountered: