Learn R Programming

hypergea (version 1.3.6)

getMargins: Marginal sums of multidimensional contingency tables

Description

Calculates marginal sums for \(I\times J\) and \(I\times J\times K\) tables

Usage

getMargins(x)

Arguments

x

a table (matrix, array) without missing values

Value

A list of length(dim(x)) containing the marginal sums of each dimension

Examples

Run this code
# 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