Learn R Programming

spheresmooth (version 0.1.3)

normalize: Normalize a matrix row-wise

Description

This function normalizes the rows of the input matrix x by dividing each row by its L2 norm (Euclidean norm).

Usage

normalize(x)

Value

Numeric matrix with normalized rows.

Arguments

x

Numeric matrix.

Examples

Run this code
normalize(matrix(c(1,2,3,4,5,6), nrow = 2, byrow = TRUE))

Run the code above in your browser using DataLab