Learn R Programming

vvauditor (version 0.7.0)

check_na_columns: Check for columns with only NA values

Description

This function checks if there are any columns in the provided dataframe that contain only NA values. If such columns exist, their names are added to the provided collection.

Usage

check_na_columns(df, collection)

Value

The updated collection.

Arguments

df

A dataframe.

collection

A list to store the names of the columns with only NA values.

Examples

Run this code
# Create a dataframe with some columns containing only NA values
df <- data.frame(a = c(1, NA, 3), b = c(NA, NA, NA), c = c(4, 5, 6))
collection <- checkmate::makeAssertCollection()
check_na_columns(df, collection)

Run the code above in your browser using DataLab