is.nan {math} R Documentation

Finite, Infinite and NaN Numbers

Description


is.finite and is.infinite return a vector of the same
length as x, indicating which elements are finite
(not infinite and not missing) or infinite.

Inf And -Inf are positive And negative infinity whereas
NaN means 'Not a Number’. (These apply to numeric values
and real and imaginary parts of complex values but not
to values of integer vectors.) Inf and NaN are reserved
words in the R language.

Usage

is.nan(x);

Arguments

x

R object to be tested: the default methods handle atomic vectors.

env

[as Environment]

Details

is.nan tests if a numeric value is NaN. Do not test equality to NaN, or even use identical, since systems typically have many different NaN values. One of these is used for the numeric missing value NA, and is.nan is false for that value. A complex number is regarded as NaN if either the real or imaginary part is NaN but not NA. All elements of logical, integer and raw vectors are considered not to be NaN.

All three functions accept NULL As input And Return a length zero result. The Default methods accept character And raw vectors, And Return False For all entries. Prior To R version 2.14.0 they accepted all input, returning False For most non-numeric values; cases which are Not atomic vectors are now signalled As errors.

All three functions are generic: you can write methods To handle specific classes Of objects, see InternalMethods.

Authors

SMRUCC genomics Institute

Value

A logical vector of the same length as x: dim, dimnames and names attributes are preserved.

clr value class

Examples


[Package math version 2.33.856.6961 Index]