Learn R Programming

checkmate (version 1.0)

allMissing: Check if an object contains missing values

Description

Supported are atomic types (see is.atomic), lists and data frames. Missingness is defined as NA or NaN for atomic types and data frame columns, NULL is defined as missing for lists.

Usage

allMissing(x)

anyMissing(x)

Arguments

x
[ANY] Object to check.

Value

  • [logical(1)] Returns TRUE if any (anyMissing) or all (allMissing) elements of x are missing (see details), FALSE otherwise.

Examples

Run this code
allMissing(1:2)
 allMissing(c(1, NA))
 allMissing(c(NA, NA))
anyMissing(c(1, 1))
 anyMissing(c(1, NA))
 anyMissing(list(1, NULL))

Run the code above in your browser using DataLab