R/rje-internal.R

Defines functions sweep0

.sweep0 <-
function (x, MARGIN, STATS, FUN = "-") 
{
    FUN <- match.fun(FUN)
    dims <- dim(x)
    perm <- c(MARGIN, seq_along(dims)[-MARGIN])
    FUN(x, aperm.default(array(STATS, dims[perm]), order(perm)))
}
rje42/rje documentation built on Aug. 15, 2017, 7:43 a.m.