normalize_colwise: Normalise a matrix column-wise between 0 and 1

View source: R/number_tools.R

normalize_colwiseR Documentation

Normalise a matrix column-wise between 0 and 1

Description

Normalise a matrix column-wise between 0 and 1

Usage

normalize_colwise(mat)

normalise_colwise(mat)

Arguments

mat

(Numeric) A numeric matrix.

Value

A numeric matrix. The largest value in the column will be 1, and the other values will be proportions compared to that.

Authors

Source

https://stackoverflow.com/q/14282323/5578429

Examples

normalize_colwise(matrix(1:12, ncol = 3))

#>      [,1]  [,2]      [,3]
#> [1,] 0.25 0.625 0.7500000
#> [2,] 0.50 0.750 0.8333333
#> [3,] 0.75 0.875 0.9166667
#> [4,] 1.00 1.000 1.0000000


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.