normalize_whole | R Documentation |
Normalise a whole matrix or vector between 0 and 1
normalize_whole(mat, from_zero = FALSE)
normalise_whole(mat, from_zero = FALSE)
mat |
(Numeric) A matrix or a vector. |
from_zero |
(Logical, default |
A matrix.
Desi Quintans (http://www.desiquintans.com)
mat <- matrix(1:4, ncol = 2)
#> [,1] [,2]
#> [1,] 1 3
#> [2,] 2 4
normalize_whole(mat, from_zero = TRUE)
#> [,1] [,2]
#> [1,] 0.25 0.75
#> [2,] 0.50 1.00
normalize_whole(mat, from_zero = FALSE)
#> [,1] [,2]
#> [1,] 0.0000000 0.6666667
#> [2,] 0.3333333 1.0000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.