powered by
margin.table(x, margin = NULL)
x
apply(x, margin, sum)
margin
sum(x)
prop.table
addmargins
m <- matrix(1:4, 2) margin.table(m, 1) margin.table(m, 2)
Run the code above in your browser using DataLab