I'm new to programming in R and i think this is super basic but I couldn't find another question like it. So in my df the middle column is binary and either I or D and the last column is either FA, PS, CR, DI, HD. I'm trying to count the amount of times each occurs with one another, for example how many times I occurs with CR.
1 I CR
2 D DI
3 D DI
4 D PS
5 D PS
6 D PS
7 D DI
8 D CR
9 I FA
10 D CR
I counted the totals of HD, PS, FA etc using factor then putting it into a table and so i tried doing this with conditionals for the two columns together but couldn't get it to work. If anyone could help it would be nice.