allNA: Is a vector empty?

View source: R/empty.R

allNAR Documentation

Is a vector empty?

Description

A vector is empty if all(is.na(x)) with a special case for length(x) == 0.

Usage

allNA(
  x,
  expected = FALSE,
  len0 = FALSE,
  nThread = getOption("hutilscpp.nThread", 1L)
)

Arguments

x

A vector. Only atomic vectors are supported.

expected

TRUE | FALSE Whether it is expected that x is empty. If TRUE the function will be marginally faster if x is empty but likely slower if not.

len0

The result if length(x) == 0.

nThread

Number of threads to use (only applicable if expected is TRUE)

Examples

allNA(c(NA, NA))
allNA(c(NA, NA, 1))


hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.