I remember seeing a similar issue to this, but am failing to find it at the moment.
I find current naming of columns with on syntax to be confusing and counterintuitive. This becomes especially apparent when using non-equi joins. Right now the column name is the left side in an on = .(LHS = RHS) expression and imo it would make a lot more sense for it to be the right side.
X = data.table(pos = 1:3)
# pos
#1: 1
#2: 2
#3: 3
Y = data.table(start = c(1, 3), end = c(2, 4))
# start end
#1: 1 2
#2: 3 4
Y[X, on = .(start <= pos, end >= pos)]
# start end
#1: 1 1
#2: 2 2
#3: 3 3
X[Y, on = .(pos >= start, pos <= end)]
# pos pos.1
#1: 1 2
#2: 1 2
#3: 3 4
In both cases above it would make a lot more sense imo to have the column name taken from RHS.
I remember seeing a similar issue to this, but am failing to find it at the moment.
I find current naming of columns with
onsyntax to be confusing and counterintuitive. This becomes especially apparent when using non-equi joins. Right now the column name is the left side in anon = .(LHS = RHS)expression and imo it would make a lot more sense for it to be the right side.In both cases above it would make a lot more sense imo to have the column name taken from RHS.