powered by
This function normalizes the rows of the input matrix x by dividing each row by its L2 norm (Euclidean norm).
normalize(x)
Numeric matrix with normalized rows.
Numeric matrix.
normalize(matrix(c(1,2,3,4,5,6), nrow = 2, byrow = TRUE))
Run the code above in your browser using DataLab