Zettelkasten

top

drop.columns.if.all.same.value <- function(dataframe) {
  for (name in colnames(dataframe)) {
    is.all.same <- (dataframe[, name] %>% unique() %>% length()) <= 1
    if (is.all.same) {
      dataframe <- dataframe %>%
        dplyr::select(
          -tidyselect::one_of(name)
        )
    }
  }
  dataframe
}