I am trying to figure out why I am getting an error message when using ddply.
Example data:
data<-data.frame(area=rep(c(\"VA\",\"OC\",\"ES\"),each=4)
I had a similar problem (with a different data set, but same error message), but I discovered that ddplyr used the UK spelling "summarise". Once I made the spelling change, code worked.
Here's the code I used. When I used the "z" spelling, I got the error message Error in .fun(piece, ...) : argument "by" is missing, with no default
; but changing to "s" solved it.
library(plyr)
ddply(InsectSprays,.(spray),summarise,sum=sum(count))