Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign updcast.data.table Error #1974
dcast.data.table Error #1974
Comments
|
If you're having this issue because you're calling dcast within your own function, there is a partial solution here. |
|
duplicate of #2949 |
I am using data.table 1.10.0
dt = data.table(x=sample(5,20,TRUE), y=sample(2,20,TRUE), z=sample(letters[1:2], 20,TRUE), d1 = runif(20), d2=1L)dcast.data.table(dt, x + y ~ z, fun.aggregate=list(sum, mean), value.var=list("d1", "d2"))It can work well.
I am trying to do like this:
fun.list <- list(sum, mean)value.list <- list("d1", "d2")dcast.data.table(dt, x + y ~ z, fun.aggregate=fun.list, value.var=value.list)Error occurs:
But length(fun.list) is eque to length(value.list).
length(fun.list)length(value.list)