Skip to content

[R-Forge #5443] join and get don't like each other #34

@arunsrinivasan

Description

@arunsrinivasan

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'))]

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions