# NOT RUN {
set.seed(1)
# Simulate 10x5 MVN data matrix
X=matrix(rnorm(50), nrow=10)
# Compute initial eigenvector to use with rifle method
v1.init = rifleInit(X)
# Use with rifle method to get first PC loadings with 2 non-zero elements
rifle(A=cov(X), B=diag(5), init=v1.init, k=2)
# }
Run the code above in your browser using DataLab