not.na: Opposite of 'is.na()'

View source: R/vector_tools.R

not.naR Documentation

Opposite of is.na()

Description

Checks that vector elements are not NA. This is more readable and noticeable than !is.na(vec), and more compact than is.na(vec) == FALSE.

Usage

not.na(vec)

Arguments

vec

(Vector) Any vector.

Value

A logical vector of the same length as vec, with elements either TRUE when the element isn't NA, or FALSE when it is NA.

Authors

Examples

x <- c(1, NA, 2, 3, 4)

is.na(x)

## [1] FALSE  TRUE FALSE FALSE FALSE

not.na(x)

## [1]  TRUE FALSE  TRUE  TRUE  TRUE


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.