percentageOfSum: Percentage of the Sum of Values

View source: R/stat.R

percentageOfSumR Documentation

Percentage of the Sum of Values

Description

Percentage of the Sum of Values

Usage

percentageOfSum(x, na.rm = TRUE)

Arguments

x

vector of numeric values

na.rm

passed to max

Value

100 * x / sum(x)

Examples

p <- percentageOfSum(1:10)
stopifnot(sum(p) == 100)


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.