Skip to contents

Scan a data.frame or tibble and identify rows that contain any "void" values. Void values include NA, NULL, and empty strings (""), which can be toggled via parameters.

Usage

rows_with_void(
  data,
  include_na = TRUE,
  include_null = TRUE,
  include_empty_str = TRUE
)

Arguments

data

A data.frame or tibble.

include_na

Logical. Detect NA if TRUE. Default: TRUE.

include_null

Logical. Detect NULL if TRUE. Default: TRUE.

include_empty_str

Logical. Detect "" if TRUE. Default: TRUE.

Value

A logical vector indicating if each row contains any void values.

Examples

df <- data.frame(id = 1:3, name = c("A", "", "C"), score = c(10, NA, 20))
rows_with_void(df)
#> [1] FALSE  TRUE FALSE
df[rows_with_void(df), ]
#>   id name score
#> 2  2         NA