Skip to content

[R-Forge #5444] eval(parse is not working in (complex) j-expressions #33

Closed

Description

@arunsrinivasan

Submitted by: Eduard Antonyan; Assigned to: Nobody; R-Forge link

Here's an example:

rm(dt)
rm(dt1)
dt = data.table()
dt[, {dt1 = data.table(a = 1:4); eval(parse(text = 'dt1[, a := 2]'))}]

Error in eval(expr, envir, enclos) : object 'dt1' not found

It works fine without the eval/parse:

dt[, {dt1 = data.table(a = 1:4); dt1[, a := 2]}]

old and bad example, left here for reference

dt = data.table()
dt[, {eval(parse(text = 'print("boo")')); NULL}]

NULL

Pretty sure this is a recently introduced bug and it used to work before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions