Hi,

An example data set is:

group    level    color
A        1        "blue"
A        1        "Red"
B        1        "blue"
B        2        "Red"
A        2        "Red"
B        2        "Red"
B        2        "blue"
B        2        "blue"
A        2        "blue"
A        2        "Red"


I'd like to compute a summary of counts for each combination of group, level, color.

An example output would be something like this:
group    level    color        count
A        1        "blue"        1
A        2        "red"        2
B        2        "red"        2
etc..


The tapply function seems to do this for a single variable, but I can figure out to to do it for combinations of more than one factor. I also see the ave function, but can't figure out how to apply it to multiple factors.

Any suggestions?

Thanks

______________________________________________
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