Learn R Programming

mulgar (version 1.0.5)

norm_vec: Normalise a vector to have length 1

Description

Returns the normalised vector, where the sum of squares is equal to 1

Usage

norm_vec(x)

Value

numeric vector

Arguments

x

numeric vector

Examples

Run this code
x <- rnorm(5)
norm_vec(x)

Run the code above in your browser using DataLab