Learn R Programming

HH (version 3.1-47)

rowPcts: Row and columns percents

Description

Row and columns percents.

Usage

rowPcts(x, ...)
colPcts(x, ...)

Arguments

x

numerical matrix

Additional arguments for rowSums

Value

Calculate percents by row or column. The rowSums or colSums are stored in the Sums attribute of the result.

See Also

rowSums

Examples

Run this code
# NOT RUN {
tmp <- matrix(1:12, 3, 4,
              dimnames=list(c("A","B","C"),
                            c(letters[4:7])))
tmp
rowPcts(tmp)
colPcts(tmp)
# }

Run the code above in your browser using DataLab