A trivial scaling function. You might as well use base::scale, which allows arbitrary centers and scales, but returns a matrix by default.
matrix
z(x)
A numeric vector.
A vector of z-values of the same length as x.
x
# NOT RUN { x <- rnorm(500, mean = 10, sd = 5) z_vals <- z(x) round(c(mean = mean(z_vals), sd = sd(z_vals)), 2) # }
Run the code above in your browser using DataCamp Workspace