Function that standardizes the data before running the fitting algorithm. This is used in the sail function

standardize(x, center = TRUE, normalize = FALSE)

Arguments

x

data to be standardized

center

Should x be centered. Default is TRUE

normalize

Should x be scaled to have unit variance. Default is FALSE

Value

list of length 3:

x

centered and possibly normalized x matrix

bx

numeric vector of column means of x matrix

sx

standard deviations (using a divisor of n observations) of columns of x matrix