n1normed: Norm a vector such that ||x||_1 is equal to the length of x

View source: R/function_norms.R

n1normedR Documentation

Norm a vector such that ||x||_1 is equal to the length of x

Description

Norm a vector such that ||x||_1 is equal to the length of x

Usage

n1normed(x, to)

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(as.matrix(same.values), type = "O"))
normed.values <- n1normed(same.values)
print(norm(as.matrix(normed.values), type = "O"))

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