-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
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
dcast.data.table eval(fun.aggragate) -- fails when called inside function with internal aggregation function declaration #1369
Comments
It's interesting to see that this case fails too:
|
It seems to me that issue #713 was fixed only if the variable name for the passed func is always "fun.aggregate": This example works in contrast to the previous one:
|
I think I am having an issue with this bug, but I wanted to be sure it was the same issue. I was trying to define an fun.aggregate within a function before a call to dcast. A trivial example: wrapper <- function() {
f <- function(x) list(x)
dcast(data, y ~ x + b, fun.aggragate = f)
} I had attempted to trying to find f using get() by targetting specific sys.call environments. I also attempted to attach f into a new.env() from base environemnt. So is "d0rg0ld commented on Oct 2, 2015" comment still the best approache currently? |
Related question on SO: R data.table function doesn't recognize an already-specified argument |
Referring to issue #713 I think I just found a related bug.
Declaring and passing an aggregation function within a function calling dcast.data.table fails on my machine
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.2 (Yosemite)
data.table_1.9.6
Here is an example:
The text was updated successfully, but these errors were encountered: