R/remove_all_na_cols.R

Defines functions remove_all_na_cols

Documented in remove_all_na_cols

#' @title Remove any columns where all the values are missing
#'
#' @description Pass a data frame and returns a version where all columns
#' made up of entirely missing values are removed.
#'
#' @details
#' This is used within `rwa()`.
#'
#' @param df Data frame to be passed through.
#'
#' @export
remove_all_na_cols <- function(df){
  Filter(function(x)!all(is.na(x)),df)
}
martinctc/rwa documentation built on Feb. 19, 2025, 11:17 a.m.