not.nan | R Documentation |
is.nan()
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
.
not.nan(vec)
vec |
(Vector) Any vector. |
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
.
Desi Quintans (http://www.desiquintans.com)
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.