is.number
Check If A Numeric Value Is Neither Missing nor Not-a-number
Description
Returns a logical vector, matrix or array describing the type
of numeric elements present.
This distinguishes between ordinary numbers including infinities and
missing values (NA) and not-a-number ((NaN).
Usage
is.number(x)
Arguments
x |
numeric vector, matrix or array.
|
Value
an object similar to the input which is filled logical values.
Values will be TRUE if the value is finite or infinite, i.e., is
neither missing (NA) nor not-a-number (NaN).
Values will be FALSE for vectors that are not of mode "numeric".
Differences between Spotfire Enterprise Runtime for R and Open-source R
is.number is not implemented in open-source R.
See Also
Examples
# a non-zero number divided by zero creates infinity
# zero over zero creates a NaN
weird.values <- c(1/0, -20.9/0, 0/0, NA)
is.infinite(weird.values)
is.nan(weird.values)
is.na(weird.values)
is.number(weird.values)