## Sample table
data(Titanic)
tab <- apply(Titanic, c(1, 4), sum)
## Column percentages
rprop(tab)
## Column percentages with custom display
rprop(tab, digits = 2, percent = TRUE, total = FALSE)
## Could be applied to a table of 3 dimensions or more
rprop(Titanic)
Run the code above in your browser using DataLab