Learn R Programming

vvauditor (version 0.7.0)

check_zero_columns: Check for Columns with Only 0s

Description

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

Usage

check_zero_columns(dataframe, collection)

Value

The updated collection.

Arguments

dataframe

A dataframe.

collection

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

Examples

Run this code
# Create a dataframe with some columns containing only 0 values
dataframe <- data.frame(a = c(0, 0, 0), b = c(1, 2, 3), c = c(0, 0, 0))
collection <- checkmate::makeAssertCollection()
check_zero_columns(dataframe, collection)

Run the code above in your browser using DataLab