Learn R Programming

SwathXtend (version 1.0.0)

medianNorm: Utility to median normalize a matrix by columns

Description

Divide appropriately to make all column medians equal to the max median

Usage

medianNorm(mat)

Arguments

mat
Data matrix to normalize; matrix assumed positive

Value

Matrix of same dimensions.

Details

References

See Also

Examples

Run this code
mat = 100+matrix(rnorm(1000), ncol=10)
mat[,10] = mat[,10] + 2
layout(matrix(1:2, nrow=1))
boxplot(mat)
boxplot(medianNorm(mat))

# note: issues when medians close to 0.

Run the code above in your browser using DataLab