prop.table: Express Table Entries as Fraction of Marginal Table

Description Usage Arguments Value Author(s) See Also Examples

View source: R/table.R

Description

This is really sweep(x, margin, margin.table(x, margin), "/") for newbies, except that if margin has length zero, then one gets x/sum(x).

Usage

1
prop.table(x, margin = NULL)

Arguments

x

table

margin

index, or vector of indices to generate margin for

Value

Table like x expressed relative to margin

Author(s)

Peter Dalgaard

See Also

margin.table

Examples

1
2
3
m <- matrix(1:4, 2)
m
prop.table(m, 1)

robertzk/monadicbase documentation built on May 27, 2019, 10:35 a.m.