powered by
Scan a data.frame or tibble and identify columns that contain any "void" values. Void values include NA, NULL, and "", which can be toggled via parameters.
NA
NULL
""
cols_with_void( data, include_na = TRUE, include_null = TRUE, include_empty_str = TRUE, return_names = TRUE )
A character vector (column names) or logical vector indicating void presence per column.
A data.frame or tibble.
Logical. Detect NA if TRUE. Default: TRUE.
Logical. Detect NULL if TRUE. Default: TRUE.
Logical. Detect "" if TRUE. Default: TRUE.
Logical. If TRUE (default), return column names; else logical vector.
df <- data.frame(name = c("A", "", "C"), score = c(1, NA, 3), id = 1:3) cols_with_void(df) cols_with_void(df, return_names = FALSE) cols_with_void(df, include_na = FALSE)
Run the code above in your browser using DataLab