R/only_informative_columns.R

Defines functions only_informative_columns

Documented in only_informative_columns

#' Remove all singleton columns
#'
#' @param .x a tibble or data table with more than one row
#'
#' @return a tibble that may have fewer columns
#' @export
only_informative_columns <- function(.x) {
    dplyr::select(.x, tidyselect::where(~dplyr::n_distinct(.) > 1))
}
higherX4Racine/hiRx documentation built on Nov. 18, 2024, 10:20 a.m.