set.seed(1234)
n <- 20
c1 <- rbinom(n, 1, .4)
c2 <- 1 - c1
c3 <- rnorm(n)
c4 <- 10 * c3
mat <- data.frame(c1, c2, c3, c4)
make_full_rank(mat) #leaves c2 and c4
make_full_rank(mat, with.intercept = FALSE) #leaves c1, c2, and c4
Run the code above in your browser using DataLab