Open markfairbanks opened 1 year ago
I think the easiest solution is to wait until the newest version of data.table
is on CRAN and we can use the new env
arg.
suppressMessages(library(data.table))
df <- data.table(x = 1:3, y = 1:3)
x <- 3
df[x < .env_x, env = list(.env_x = x)]
#> x y
#> <int> <int>
#> 1: 1 1
#> 2: 2 2
We could probably just even detect if .env
is used and do something like this.
suppressMessages(library(data.table))
df <- data.table(x = 1:3, y = 1:3)
x <- 3
df[x < .env$x, env = list(.env = environment())]
#> x y
#> <int> <int>
#> 1: 1 1
#> 2: 2 2
This one is going to be a tough one since the
..
shortcut doesn't work ini