l2norm: Calculate the L2 (Euclidean) norm of a vector

Description Usage Arguments Details Value Author(s) Examples

View source: R/r-utility-l2norm.R

Description

This function calculates the L2 (Euclidean) norm of a numeric vector. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1
l2norm(v)

Arguments

v

a numeric vector

Details

The L2 (Euclidean) norm is calculated as the square root of the sum of squared vector elements.

Value

sqrt(sum(v^2))

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

Examples

1
2
l2norm(3:4)
l2norm(rep(3, 4))

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.