Learn R Programming

fungible (version 2.2.2)

vnorm: Norm a Vector to Unit Length

Description

Norm a vector to unit length.

Usage

vnorm(x)

Value

the scaled (i.e., unit length) input vector

Arguments

x

An n by 1 vector.

Author

Niels Waller

Examples

Run this code

 x <- rnorm(5)
 v <- vnorm(x)
 print(v)

Run the code above in your browser using DataLab