Learn R Programming

Rtreemix (version 1.34.0)

L2.norm: L2 norm of a given vector

Description

A function for calculating the L2 norm of a given numeric vector.

Usage

L2.norm(x)

Arguments

x
A numeric vector.

Value

The function returns the L2 norm of the given vector x.

See Also

L1.dist

Examples

Run this code
## Define a numeric vector
y <- c(1, 2, 3, 4)

## Calculate the L2 norm of the vector y
L2.norm(y)

Run the code above in your browser using DataLab