Hi, people. I am using R-2.5.0 now, when tried the function aggregate with sum, it showed an error as following: > a <- gl(3,10) > b <- rnorm(30) > aggregate(b,list(a),sum) # here is the error message, it complained that an error in FUN(X[[1L]], missing "INDEX", and no defaults value.
but the tapply function will be okay. > tapply(b,list(a),sum) 1 2 3 2.113349 -5.972195 4.854731 furthermore, when I was using the R-2.5.0 pre-release version before. it could work well. > a <- gl(3,10) > b <- rnorm(30) > aggregate(b,list(a),sum) # it works well Group.1 x 1 1 -1.0330482 2 2 0.1235796 3 3 -1.0086930 > tapply(b,list(a),sum) # so does tapply 1 2 3 -1.0330482 0.1235796 -1.0086930 So, who can tell what should I do to overcome this? thanks a lot. [[alternative HTML version deleted]] ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.