-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Submitted by: Eduard Antonyan; Assigned to: Arun ; R-Forge link
I've been getting unpredictable behaviours when using joins and get together. Here's an example that results in an error (in my real-life example the situation is actually much worse, in that I don't get an error but get incorrect results instead - I wasn't able to replicate it in a small example and am hoping it's the same issue as the one below):
dt1 = data.table(a = 1:2, b = 1:2, key = 'a')
dt2 = data.table(a = 1:2, c = 2:1, key = 'a')
dt1[dt2, list(c, get('b'))]
#Error in rep(x[[i]], length.out = mn) :
# attempt to replicate an object of type 'builtin'
These all work though:
dt1[dt2, list(c, b)]
dt1[dt2, list(a, get('b'))]
dt1[dt2, list(b, get('b'))]
dt1[dt2][, list(c, get('b'))]