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.

check_na_columns(df, collection)

Arguments

df

A dataframe.

collection

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

Value

The updated collection.

Examples

# 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)
#> Collection of 1 assertion.