n2normed: Norm a vector such that ||x||_2 = 1 is equal to the length of

View source: R/function_norms.R

n2normedR Documentation

Norm a vector such that ||x||_2 = 1 is equal to the length of

Description

Norm a vector such that ||x||_2 = 1 is equal to the length of

Usage

n2normed(x, to = NA)

Arguments

x

numeric vector

to

numeric, to this value, the norm gets scaled

Value

numeric vector with same length as x

Examples

set.seed(1)
same.values <- rnorm(n = 10)
print(norm(same.values, type = "2"))
normed.values <- n2normed(same.values)
print(norm(normed.values, type = "2"))

MarianSchoen/DTD documentation built on April 29, 2022, 1:59 p.m.