Skip to contents

Flag a constant or near-constant column

Usage

data_check_constant(x, threshold = 0.99)

Arguments

x

a vector

threshold

if the most common non-NA value covers at least this fraction, the column is near-constant

Value

list(problem, message, values)

Author

Daniel Lakens and Levi Baruch

Examples

data_check_constant(rep(1, 40))$message
#> [1] "Column is constant: every value is \"1\"."