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