Learn R Programming

ProcMod (version 1.0.8)

bicenter: Double centering of a matrix.

Description

colSums and rowSums of the returned matrix are all equal to zero.

Usage

bicenter(m)

Arguments

m

a numeric matrix

Value

a numeric matrix centred by rows and columns

Details

Inspired from the algorithm described in stackoverflow https://stackoverflow.com/questions/43639063/double-centering-in-r

Examples

Run this code
# NOT RUN {
data(bacteria)
bact_bc <- bicenter(bacteria)
sum(rowSums(bact_bc))
sum(colSums(bact_bc))

# }

Run the code above in your browser using DataLab