I would like to add the frequency numbers of each combination on a cross-tabulation plot.
For example, with the mtcars example:
data("mtcars")
table(mtcars$vs, mtcars$am)
We have the number of each combination between $vs and $am columns. If I directly plot this, I get 4 rectanges which size vary based on the frequency numbers:
plot(table(mtcars$vs, mtcars$am), main = "Cross tabulation plot",
xlab = "Engine (vs)", ylab = "Transmission (am)")
Would it be possible to print these frequency numbers within the corresponding rectangle in an elegant way?

