Thanks!

I tried reading the help for aggregate and can't figure out which form of the formula I am using, and therefore the syntax.

I'm getting the below error.

> aggregate(counts ~ ind, merge(stack(CAT2COG), df, by = 1), sum)
Error in as.data.frame.default(x) :
  cannot coerce class "formula" into a data.frame
> aggregate(counts ~ Cats, merge(stack(CAT2COG), df, by = 1), sum)
Error in as.data.frame.default(x) :
  cannot coerce class "formula" into a data.frame
> Cats
[1] A B C D E
Levels: A B C D E
> aggregate(counts ~ COGs, merge(stack(CAT2COG), df, by = 1), sum)
Error in as.data.frame.default(x) :
  cannot coerce class "formula" into a data.frame
On 24-Oct-10, at 12:50 AM, Gabor Grothendieck wrote:

aggregate(counts ~ ind, merge(stack(CAT2COG), df, by = 1), sum)

______________________________________________
R-help@r-project.org 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.

Reply via email to