normalizeR: Normalize each row of a matrix by the sum of its elements

View source: R/misc.R

normalizeRR Documentation

Normalize each row of a matrix by the sum of its elements

Description

Normalize each row of a matrix by the sum of its elements

Usage

normalizeR(x, m, n)

Arguments

x

A matrix of dimensions m X n.

m

The number of rows of the matrix.

n

The number of columns of the matrix.

Value

A matrix of dimensions m X n with each row summing up to 1.

Examples

## Not run: 
normalizeR(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.