R, correlation: is there a func that converts a vector of nums to a vector of standard units -


is there function in r given vector of numbers, returns vector standard units corresponding each value?

where... standard unit: how many sds value + or - mean

example:

 x <- c(1,3,4,5,7)    # note: mean=4, sd=2  su(x)   [1]  -1.5  -0.5  0.0  0.5  1.5 

is (ficticious) "su" func included in package?

thanks.

yes, scale():

x <- c(1,3,4,5,7) scale(x) 

Comments