test <- data.frame(v1=seq(0.1, 5, length=100), v2=seq(0.1, 5, length=100),
v3=dnorm(runif(100)), v4=dnorm(runif(100)))
( cl <- MultiColinear(test) )
# PCA biplot of variables
pca.test <- prcomp(test[,1:ncol(test)], scale=TRUE)
biplot(pca.test, arrow.len=0.1, xlabs=rep(".", length(pca.test$x[,1])))
# Remove identified variable(s)
test <- test[,-which(names(test)==cl)]Run the code above in your browser using DataLab