I used to have 2 factor by 2 level experiment that got made into a 3 factor by 2 level experiment.
By using paste I could make 4 unique groups from my two factors and run a Fisher test with the outcome being whether an organism lived or died.
fisher.test(mortal$alv.dead,paste(mortal$Strain,mortal$capsule))
But then when I wanted to investigate pairwise comparisons between the individual groups I had to make some inelegant filtering so that only two groups entered the analysis at a time. Now that I have more groups it is too tedious to hand code each paring. So here is the Fisher test to test all the groups in one analysis
fisher.test(mortal$alv.dead,paste(mortal$Strain,mortal$capsule,mortal$cassette))
How do I set up a method that creates and tests all possible pairings?