| normalize | R Documentation |
Normalizes a vector or each record of a matrix into a simplex.
normalize(x)
x |
Numeric vector or matrix. If vector, then the vector will be normalized to sum to one. If matrix, then each record will be normalized to sum to one (and a matrix returned). |
Returns a vector or matrix whose elements (if vector) or records (if matrix) are computed as x/sum(x). This normalizes a vector or matrix record into a set of proportions which sum to one (i.e., a simplex). If a matrix is provided for the x argument, then normalization is performed independently for each record.
A numeric vector or matrix whose elements (if vector) or records (if matrix) sum to one.
softmax for the softmax function.
# Normalize vector.
normalize(x=c(3,1,5,7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.