R/rowPcts.R

Defines functions colPcts

Documented in colPcts

rowPcts <- function (x, ...)
{
    rSx <- rowSums(x, ...)
    result <- x/(rSx/100)
    Zero <- rSx == 0
    result[Zero,] <- 0
    structure(result, Sums = rSx)
}

colPcts <- function(x, ...)
  t(rowPcts(t(x, ...)))

Try the HH package in your browser

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

HH documentation built on Aug. 9, 2022, 5:08 p.m.