> what's different from:
>  > with(dat, tapply(x, list(name,case), sum))
>        1  2  3
> Joe   1  1 NA
> John NA  1 NA
> Karl NA NA  0
> Mike  1  0  1
>
> and how to deal with this table ?

Well, the syntax is easier (once you have the data in the correct,
molten, form), and more flexible for other tasks.  It is surely better
to learn a general purpose tool rather than a tool for a specific
task.

To use that table to answer the original question, you just need to
look column by column for the desired patterns of 0's and 1's, eg. in
case 1, Joe, Mike and Zoe all had ones.   Perhaps I misunderstood the
original question.

Hadley

______________________________________________
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.

Reply via email to