normalizeV: Normalize a vector by the sum of its elements

View source: R/misc.R

normalizeVR Documentation

Normalize a vector by the sum of its elements

Description

Normalize a vector by the sum of its elements

Usage

normalizeV(x)

Arguments

x

A vector of dimension n.

Value

A vector of dimension n with its elements summing up to 1.

Examples

## Not run: 
normalizeV(c(1,3))
normalizeV(matrix(c(1,2,3,4), nrow=2, ncol = 2), 2, 2)

## End(Not run)

melmasri/traveltimeHMM documentation built on Jan. 6, 2023, 10:30 p.m.