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

merge.data.table method should behave like merge.data.frame when by isn't specified and keys aren't set? #1517

Closed
DavidArenburg opened this issue Feb 3, 2016 · 0 comments
Assignees
Milestone

Comments

@DavidArenburg
Copy link
Member

library(data.table) ## v1.9.7
DT <- data.table(A = letters[1:3], B = letters[4:6])
DT2 <- DT[, .(A)]

merge(DT, DT2)
# Error in merge.data.table(DT, DT2) : 
#   Can not match keys in x and y to automatically determine appropriate `by` parameter. Please set `by` value explicitly.

merge(setDF(DT), setDF(DT2)) ## uses `by = intersect(names(x), names(y)` by default
#   A B
#1 a d
#2 b e
#3 c f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants