# Remove constant df <- data.frame( x1 = c(1, 2, 3), x2 = c(4, 5, 6), x3 = c(7, 7, 7) ) df %>% remove_constant()