Learn R Programming

textir (version 1.8-5)

freq: Frequency Matrix Conversion

Description

Convert a count matrix to the corresponding frequency matrix.

Usage

freq(x, byrow=TRUE)

Arguments

x
A matrix or simple_triplet_matrix with count entries.
byrow
An indicator for whether you have observation-rows and category-columns, or vice versa.

Value

  • A matrix with row (byrow=TRUE) or column (byrow=FALSE) sums of one.

See Also

corr, pls

Examples

Run this code
freq( t(rmultinom(10, 20, c(1/2,1/4,1/8,1/8))) )

Run the code above in your browser using DataLab