-
Notifications
You must be signed in to change notification settings - Fork 985
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) -- cannot pass as an argument #713
Comments
@mathematicalcoffee, thank you very much. Will fix asap. |
Definitely a bug, because
returns what I would expect to get from |
Previous fix masked fun.aggregate to .CASTfun. It'll never run GForce even for 'mean', 'sum' etc. Rectified that here.
Was this every fixed in the CRAN data.table package? I am still having this issue of a passed in function argument failing in eval. |
@Horizon-cmchugh considering it was closed almost 3 years ago, this issue is on CRAN. Have you looked at #1369, which is still open? |
@MichaelChirico I have. I made a Stack Overflow post a few weeks ago, which was added as a bug by one of the moderators here, but closed as a duplicate of #1369. Oh well. |
Referred from SO question
Affects 1.9.3 (and not 1.9.2)
TL;DR
If you have a function that calls
dcast.data.table
, you can't seem to passfun.aggregate
into that call from the function argument.Because of an
eval(fun.aggregate)
withindcast.data.table
.Example
I have a table like this:
I reshape to long format, retaining the last occurence of duplicates
However if I wrap my dcast.data.table call into a function:
It looks like the symbol fun.aggregate is being evaluated (eval(fun.aggregate)) and not found (since the function "fun.aggregate" does not exist).
Is there a way to "protect" a function argument from the
eval()
call when I pass it in (i.e. perhaps this behaviour is intended), or perhaps this is a bug. My personal opinion is that it is a bug, because this works fordcast
and notdcast.data.table
, and the two should be consistent.The text was updated successfully, but these errors were encountered: