Skip to content

on= could accept unnamed columns in i #1375

@mattdowle

Description

@mattdowle

e.g. ad hoc joins

require(data.table)
X = data.table(a=1:3,b=4:6,c=c("foo","bar","baz"))
X[.(5), on="b"]
# Error in bmerge(i, x, leftcols, rightcols, io, xo, roll, rollends, nomatch,  : 
#   Internal error. icols[0] is NA

desired output

X[.(b=5), on="b"]
#    a b   c
#1: 2 5 bar

and where one join column has the same name but not the other :

X = data.table(A=1:3,b=4:6,c=c("foo","bar","baz"))
Y = data.table(A=2:4, B=5:7)
X[Y, on=c("A",b="B")]
# Error in forderv(x, by = rightcols) : 
#   'by' value -2147483648 out of range [1,3]
X[Y, on=c(A="A",b="B")]
#    A b   c
#1: 2 5 bar
#2: 3 6 baz
#3: 4 7  NA

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions