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?