norm1: Normalize a vector to length 1

View source: R/norm1.R

norm1R Documentation

Normalize a vector to length 1

Description

Scales a vector to a unit vector.

Usage

norm1(x)

Arguments

x

a numeric vector

Author(s)

Matthias Templ

Examples


data(expenditures)
i <- 1
D <- 6
vec <- c(rep(-1/i, i), 1, rep(0, (D-i-1)))

norm1(vec)


robCompositions documentation built on Aug. 25, 2023, 5:13 p.m.