I need to remove all columns with more than 1 zero. I am currently using df <- df[, colSums(df != 0) > 1] but this does not work for all of the columns with many zeros. How can this be fixed or approached a different way?
> tibble(df)
# A tibble: 551 x 1,046
`aa` `ab` `ac` `ad` `ae` `af`
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 32458 65068 32654 0 43115 1450
2 19387 38457 19447 0 22523 958
3 42690 85105 43247 0 14156 1088
4 62290 123325 61878 58422 36300 1145