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 April 12, 2025, 1:17 a.m.