normalize_colwise | R Documentation |
Normalise a matrix column-wise between 0 and 1
normalize_colwise(mat)
normalise_colwise(mat)
mat |
(Numeric) A numeric matrix. |
A numeric matrix. The largest value in the column will be 1
, and the other
values will be proportions compared to that.
https://stackoverflow.com/q/14282323/5578429
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.