normalize: Normalize a vector of probabilities

normalizeR Documentation

Normalize a vector of probabilities

Description

Given a vector of probabilities, normalize ensures they sum up to 1.

Usage

normalize(x, ...)

## Default S3 method:
normalize(x)

Arguments

x

A numeric vector of probabilities, or an object from a class for which a method has been defined.

Details

This is a generic function. Methods can be written for classes holding probability distributions. The default method takes a vector x and returns x / sum(x). Specific methods should normalize the element holding the probabilities within the object, and return the modified version of that object.

Value

A numeric vector, or an object from a class for which a method has been created.


rmvegasm/schron documentation built on June 3, 2022, 7:14 a.m.