Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

all_na

Check if vector only has NA values


Description

Check if all values in a vector are NA.

Usage

all_na(x)

Arguments

x

A vector or data frame.

Value

Logical, TRUE if x has only NA values, FALSE if x has at least one non-missing value.

Examples

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))

sjmisc

Data and Variable Transformation Functions

v2.8.6
GPL-3
Authors
Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>), Iago Giné-Vázquez [ctb], Alexander Bartel [ctb] (<https://orcid.org/0000-0002-1280-6138>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.