# \donttest{
if (requireNamespace("caret", quietly = TRUE)) {
X <- cbind(1:5, 2 * (1:5), rnorm(5))
colnames(X) <- c("x1", "x2", "x3")
drop_collinear(X) ## x2 dropped as collinear with x1
}
# }
Run the code above in your browser using DataLab