Chi-square & Fisher’s Test

Chi-square test of independence and Fisher’s exact test in R — from a 2×2 table to a p-value, with the expected counts and when to use each.

Are two categorical variables associated? Test it with a contingency table.