Learn R Programming

sjmisc (version 2.8.10)

all_na: Check if vector only has NA values

Description

Check if all values in a vector are NA.

Usage

all_na(x)

Value

Logical, TRUE if x has only NA values, FALSE if

x has at least one non-missing value.

Arguments

x

A vector or data frame.

Examples

Run this code
x <- c(NA, NA, NA)
y <- c(1, NA, NA)

all_na(x)
all_na(y)
all_na(data.frame(x, y))
all_na(list(x, y))

Run the code above in your browser using DataLab