For a contingency table in array form, compute the sum of table entries for a given index.
margin.table(x, margin = NULL)
| Parameter | Description |
|---|---|
x |
an array |
margin |
index number (1 for rows, etc.) |
# NOT RUN {
m <- matrix(1:4, 2)
margin.table(m, 1)
margin.table(m, 2)
# }