Normalize a vector
norm1(v)
v
A vector.
This function normalizes any non-zero vector and returns a vector with the norm equal to 1.
A vector with norm 1.
data <- gen.data(n=100) y.norm1 <- norm1(data$y)