powered by
Calculates marginal sums for \(I\times J\) and \(I\times J\times K\) tables
getMargins(x)
a table (matrix, array) without missing values
A list of length(dim(x)) containing the marginal sums of each dimension
length(dim(x))
# NOT RUN { x <- matrix(c(1:4), nrow=2, ncol=2) getMargins(x) x <- matrix(c(1:6), nrow=2, ncol=3) getMargins(x) x <- array(c(1:8), dim=c(2,2,2)) getMargins(x) # }
Run the code above in your browser using DataLab