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

View source: R/vector_tools.R

not.nanR Documentation

Opposite of is.nan()

Description

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

Usage

not.nan(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 NaN, or FALSE when it is NaN.

Authors

Examples

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

is.nan(x)

## [1] FALSE  TRUE FALSE FALSE FALSE

not.nan(x)

## [1]  TRUE FALSE  TRUE  TRUE  TRUE


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