R: Marginal sums of multidimensional contingency tables

getMargins {hypergea} | R Documentation

## Marginal sums of multidimensional contingency tables

### Description

Calculates marginal sums for IxJ and IxJxK 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

    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)

[Package hypergea version 1.3.6 Index]