aggregate function works fine
aggregate(weight ~ feed, data = chickwts, mean)
feed weight
1 casein 323.5833
2 horsebean 160.2000
3 linseed 218.7500
4 meatmeal 276.9091
5 soybean 246.4286
6 sunflower 328.9167
But after loading library(memisc) in R 2.14.1, the same code produces the following error
Error in `[.default`(xj, i) : invalid subscript type 'closure'
What is the problem and how to solve this? Thanks in advance for your help.
This package redefines the
aggregatemethod.There is often a warning in those cases, but since
aggregate.formulais a hidden method, there is no warning.You can explicitely use the initial
aggregatefunction by specifying its namespace(three colons are needed because it is a hidden method).