# Create a 6 by 4 contingency table
set.seed(42)
dat_mat <- matrix(rpois(6*4, 20), nrow=6)
dat_mat
# Assign row and column names
contin_table <- check_and_fix_contin_table(dat_mat)
contin_table
# Compute the expected counts of the contingency table
get_expected_counts(contin_table)
Run the code above in your browser using DataLab