R/cen.R

cen <- function (X, w = rep(1, nrow(X))/nrow(X)) 
{
    X <- as.matrix(X)
    n <- nrow(X)
    p <- ncol(X)
    wm <- t(w) %*% X
    e <- matrix(rep(1, n), ncol = 1)
    Xc <- X - e %*% wm
    return(Xc)
}

Try the ToolsForCoDa package in your browser

Any scripts or data that you put into this service are public.

ToolsForCoDa documentation built on Sept. 20, 2021, 5:19 p.m.