get_all_na_cols: Extract columns that are all 'NA' from a tibble

get_all_na_colsR Documentation

Extract columns that are all 'NA' from a tibble

Description

This helper function extracts the names of the columns in a tibble having NA values for all observations.

Usage

get_all_na_cols(tbl)

Arguments

tbl

R object(dataframe or tibble) of the input tibble

Value

A vector string indicating either that the tibble does not have empty columns or the names of the empty columns.

Examples

{

##### Example 1 -------------------------------------------------------------
# All columns have observation
get_all_na_cols(iris)

##### Example 2 -------------------------------------------------------------
# One column doesn't have any observations
library(dplyr)
get_all_na_cols(mutate(iris, new_col = NA))

}


fabR documentation built on May 29, 2024, 2:58 a.m.