Check for NaN Values in Data Frame
is.nan.data.frame.Rd
This function checks each element of a data frame to determine if it is NaN
(Not a Number). It returns a logical matrix where each element is TRUE
if
the corresponding element in the data frame is NaN, and FALSE
otherwise.
Usage
# S3 method for class 'data.frame'
is.nan(x)
Value
A logical matrix of the same dimensions as the input data frame,
with TRUE
indicating NaN values and FALSE
indicating non-NaN values.
Examples
df <- data.frame(a = c(1, NaN, 3), b = c(NaN, 2, NaN))
is.nan(df)
#> a b
#> 1 FALSE TRUE
#> 2 TRUE FALSE
#> 3 FALSE TRUE