# NOT RUN {
# Generate an example data set consisting of 5 rows (variables)
# and 200 columns (observations) by randomly drawing integers
# between 1 and 3.
mat <- matrix(sample(3, 1000, TRUE), 5)
# Generate the matrix containing the contingency tables for each
# pair of rows of mat.
out <- computeContCells(mat)
# out contains both the observed numbers of observations
# summarized by contingency tables
out$mat.obs
# and the number of observations expected under the null hypothesis
# of independence.
out$mat.exp
# If, e.g., only the observed number of observations having the same
# value is of interest, call
computeContCells(mat, computeExp = FALSE, justDiag = TRUE)
# }
Run the code above in your browser using DataLab