library(data.table)
library(tibble)
DT1 = data.table(a=1, b=2)
DT2 = data.table(a=1, c=3)
DF = data.frame(a=1, d=4)
TBL = tibble(a=1, e=5)
# fine
DT1[DT2, on='a', c := i.c]
# also fine
DT1[DF, on='a', d := i.d]
# error
DT1[TBL, on='a', e := i.e]
# Error in eval(jsub, SDenv, parent.frame()) : object 'i.e' not found
DT1
# a b c d
# <num> <num> <num> <num>
# 1: 1 2 3 4
This is inconsistent -- either we should require i to be a data.table (so DT1[DF, ...] would fail), or we should treat all is.data.frame(i) && !is.data.table(i) cases the same.
This is inconsistent -- either we should require
ito be a data.table (soDT1[DF, ...]would fail), or we should treat allis.data.frame(i) && !is.data.table(i)cases the same.