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
{{ message }}
Repository navigation
three data.table merge behavior inconsistency #4772
thanks very very much for this excellent software!
library(data.table)
x <- data.table( a = 1:3 )
y <- data.table( a = 2:4 )
z <- data.table( a = 3:5 )
# works
merge( x , y )
# works
merge( y , z )
# fails
merge( x , merge( y , z ) )
# Error in merge.data.table(x, merge(y, z)) :
# A non-empty vector of column names for `by` is required.
# works
merge( merge( x , y ) , z )
library(data.table)
x<- data.table(a=1:3)
y<- data.table(a=2:4, key="a")
merge(x, y)
#Error in merge.data.table(x, y) : # A non-empty vector of column names for `by` is required.
I believe you can simply change lines 35 and 37 of merge.R to if (length(by) == 0L).
Activity
ecoRoland2 commentedon Oct 22, 2020
More minimal example:
I believe you can simply change lines 35 and 37 of merge.R to
if (length(by) == 0L).ecoRoland2 commentedon Oct 22, 2020
@ajdamico Please change the title to "merge fails with intersecting names if y is keyed"
MichaelChirico commentedon Sep 7, 2024
For ease of future reference: this was actually closed by #5183.
ajdamico commentedon Sep 9, 2024
thank you!!