len: Length of a Vector or Column Lengths of a Matrix

Description Usage Arguments Value See Also Examples

View source: R/len.R

Description

len calculates the Euclidean length (also called Euclidean norm) of a vector or the length of each column of a numeric matrix.

Usage

1
len(X)

Arguments

X

a numeric vector or matrix

Value

a scalar or vector containing the length(s)

See Also

norm for more general matrix norms

Examples

1
2
3
4
5
len(1:3)
len(matrix(1:9, 3, 3))

# distance between two vectors
len(1:3 - c(1,1,1))

matlib documentation built on April 4, 2018, 5:03 p.m.