The Pearson chi-squared test (`chisq.test()`) in R assesses independence between categorical variables in a contingency table.