You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ldply has trouble when .fun passes a return with NA as a column name. The following shows a fix for the make_names function in helper-quick-df.r. I did not test, but I do not think there will be any difference in computation time, especially since the modification is executed on a primitive function, sum.
> ddply(test_df, "age", .fun= function(x) table(x$health, useNA="always"))
Error in seq_len(sum(nm == "")) :
argument must be coercible to non-negative integer
after patch:
> ddply(test_df, "age", .fun= function(x) table(x$health, useNA="always"))
age very good good fair poor very poor NA
1 30 1 5 3 0 0 0
2 40 1 3 1 0 0 2
Thanks Scott - would mind having a go at creating a formal pull request? That way you could also include a test and a comment in the NEWS file describing the improvement.
ldply
has trouble when.fun
passes a return withNA
as a column name. The following shows a fix for themake_names
function inhelper-quick-df.r
. I did not test, but I do not think there will be any difference in computation time, especially since the modification is executed on aprimitive
function,sum
.Example data
before patch:
after patch:
patch:
Scott
The text was updated successfully, but these errors were encountered: