eval doesn't work on join columns

Open
#1,180 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start by running the two data.table expressions from the issue and compare their evaluation scope: the chained form returns 5, while the join form cannot find b. Trace how eval receives join columns and verify that the join form produces the same result as the working expression.

Written by the indexing model from the issue text.

Description

bug programming
dt1 = data.table(a = 1, key = 'a')
dt2 = data.table(a = 1, b = list(quote(5*a)), key = 'a')

#this works:
dt1[dt2][, eval(b[[1]], .SD)]
#[1] 5

# this doesn't (but should produce exact same result as above)
dt1[dt2, eval(b[[1]], .SD)]
#Error in eval(b[[1]], .SD) : object 'b' not found

Relevant SO post - http://stackoverflow.com/a/30899285/817778

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.