# NOT RUN {
# load corpcor library
library("corpcor")
# generate some data
p = 5
n = 5
X = matrix(rnorm(n*p), nrow = n, ncol = p)
w = c(1,1,1,3,3)/9
# standardize matrix
scale(X)
wt.scale(X)
wt.scale(X, w) # take into account data weights
# }
Run the code above in your browser using DataLab