-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
error with data.table when joining on different variables in x and y tables #694
Comments
I couldn't figure out how to do that (hence the error message), so if you know how to do it with data.table some sample code would be very helpful. |
I went to see in you code (join-dt.R) what's the issue. I understand it is a limite of
this way it work. Some insight on stackoverflow here and here Does it help or did you tried all this? |
The challenge with setting keys is that it modifies the original data tables, which I want to avoid in dplyr. |
Think the data.table guys now fixed this in devel, see Rdatatable/data.table#637. However, it might take some time until we see a new CRAN release of data.table. |
Am I correct in thinking that data.table from v1.9.6 now supports what have been the problem for this issue to be solved, as no deep copies are made anymore, or do I not fully understand the problem? |
I can confirm that v1.9.6 is still throwing this error. |
I am still getting this error. I have 2 data.tables and I am trying left_join on 2 different keys
|
Me too |
Hi,
Using dplyr 0.3.0.2, I like the new features for *_join :
left_join()
,inner_join()
,semi_join()
,anti_join()
)now allow you to join on different variables in
x
andy
tables bysupplying a named vector to
by
. For example,by = c("a" = "b")
joinsx.a
toy.b
.However, it seems not to work the same on data.frame and data.table. For data.table, it gives me an error :
#Error: Data table joins must be on same key
Here's a reproductible example :
When i tried to do an inner join with data.frame, it's ok
If I tried to do the same with data.table,I get an error.
I was expected the same result whether my tables are data.frame or data.table.
Apparently, new feature for joining on different variables in
x
andy
tables are not working with data.table. I do not know if it should, but at least I report it.If you could do something about it (probably with setkey), it would be great.
Thank you for your great work.
Christophe
The text was updated successfully, but these errors were encountered: