View source: R/normalization.R
cosnormX | R Documentation |
Normalizes a numeric matrix dividing each row (if rows=TRUE) or column (if rows=FALSE) by their L2 norm. Thus, each row (or column) has unit norm.
cosnormX(X, rows = TRUE)
X |
Numeric matrix or data.frame of any size. |
rows |
If TRUE, the operation is done by row; otherwise, it is done by column. (Defaults: TRUE). |
Cosine-normalized X.
dat <- matrix(rnorm(50),ncol=5,nrow=10)
cosnormX(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.