We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.
by
d = data.table(a = 1) q = quote(.(a)) d[, eval(q)] # a #1: 1 d[, 1, by = .(a)] # a V1 #1: 1 1 # the problem d[, 1, by = eval(q)] #Error in eval(expr, envir, enclos) : could not find function "."
The text was updated successfully, but these errors were encountered:
026f34c
Somehow this is happening again in this SO example: https://stackoverflow.com/q/57253159/1191259
library(data.table) dt_mtcars <- as.data.table(mtcars) group = ".(cyl, gear)" dt_mtcars[, .(mean_mpg = mean(mpg), median_mpg = median(mpg)), by=eval(parse(text=group))] # Error in .(cyl, gear) : could not find function "."
Sorry, something went wrong.
parse return an expression call, it will work by adding [[1L]]
expression
[[1L]]
dt_mtcars[, .(mean_mpg = mean(mpg), median_mpg = median(mpg)), by=eval(parse(text=group)[[1L]])]
I don't think it qualify for re-opening, it is easy to investigate what is being passed to eval.
eval
arunsrinivasan
No branches or pull requests
The text was updated successfully, but these errors were encountered: