0

In the book Machine learning for hackers Chapter4, there is a line of code contains ddply which is:

from.weight<-ddply(priority.train,.(From.EMail),summarize,Freq=length(Subject))

and it doesn't work.I have seen somewhere else saying that we can get the same result by changing the code to:

from.weight <- melt(with(priority.train, table(From.EMail)), value.name="Freq")
from.weight <- from.weight[with(from.weight, order(Freq)), ]

Is there any possibility that we still use ddply and make it?

tour
  • 31
  • 3
  • 1
    `ddply` and `plyr` has been retired long back. You may want to switch to `dplyr`. It would be easier to help if you create a small reproducible example along with expected output. Read about [how to give a reproducible example](http://stackoverflow.com/questions/5963269). I think you are looking for https://stackoverflow.com/questions/9809166/count-number-of-rows-within-each-group – Ronak Shah Mar 06 '21 at 02:46
  • Yes @RonakShah has a good point. Maybe it would work if you try to reference the package of the function explictly plyr::ddply – hachiko Mar 06 '21 at 05:34

0 Answers0