I'm trying to count a subset of values using another column as the marker. For any number of samples that have multiple subsets, how can I count the states of those subsets?
For example:
| Sample | subset | failure | yield |
|---|
| 1 | a | yes | 50% |
| 1 | a | no | 50% |
| 1 | b | no | 100% |
| 2 | a | yes | 100% |
| 2 | a | yes | 100% |
| 2 | b | no | 0% |
Samples have subsets "a" and "b", that fail or pass. I'm trying to find the yield of those subsets. I'm sure there's some combination of lag, diff, col number, that I can use but I can't get it. Any help or functions that I could possibly use would be greatly appreciated.
Thanks