normalize: Normalize a vector to sum to one.

Description Usage Arguments Value Note Author(s)

View source: R/utils.r

Description

Divide a vector by its sum, resulting in a vector with sum equal to one.

Usage

1

Arguments

x

vector of input data.

Value

the input divided by its sum. For the row-wise version, each row is divided by its sum.

Note

This function will return NA when any elements of the input are NA. May return Inf if the elements sum to zero.

Author(s)

Steven E. Pav [email protected]


shabbychef/ohenery documentation built on Nov. 5, 2019, 8:50 a.m.