This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/prop.table.html
prop.table {base}R Documentation

Express Table Entries as Fraction of Marginal Table

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

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

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

[Package base version 2.9.0 ]