chk_all_na: Check All Missing Values

View source: R/chk-all-na.R

chk_all_naR Documentation

Check All Missing Values

Description

Checks if all missing values using

all(is.na(x))

Pass: NA, c(NA, NA), logical(0).

Fail: 1, 1:2, "1", c(1, NA).

Usage

chk_all_na(x, x_name = NULL)

vld_all_na(x)

Arguments

x

The object to check.

x_name

A string of the name of object x or NULL.

Value

The chk_ function throws an informative error if the test fails or returns the original object if successful so it can used in pipes.

The vld_ function returns a flag indicating whether the test was met.

Functions

  • vld_all_na(): Validate All Missing Values

See Also

For more details about the use of this function, please read the article vignette("chk-families").

Other misc_checkers: chk_join(), chk_not_any_na(), chk_not_empty(), chk_unique()

Examples

# chk_all_na
try(chk_all_na(1))
try(chk_all_na(c(1, NA)))
chk_all_na(NA)
chk_all_na(c(NA, NA_character_, NA_real_))
# vld_all_na
vld_all_na(1)
vld_all_na(1:2)
vld_all_na(NA_real_)
vld_all_na(integer(0))
vld_all_na(c(NA, 1))
vld_all_na(TRUE)
vld_all_na(c(NA_real_, NA_character_))

chk documentation built on Sept. 3, 2026, 9:07 a.m.