data(bus)
X0 <- as.matrix(bus)
X1 <- X0[,-9]
ss <- apply(X1, 2, mad)
mu <- apply(X1, 2, median)
X <- scale(X1, center=mu, scale=ss)
q <- 3 #compute three components
rr <- pcaRobS(X, q, 0.99)
round(rr$eigvec, 3)
Run the code above in your browser using DataLab