Learn R Programming

bioRad (version 0.12.0)

is.nan.data.frame: Check for NaN values in data frames

Description

S3 method for is.nan that works with data frames. Identifies cells with NaN (not a number) in a data frame, extending the base function which only works on vectors.

Identify cells with NaN (not a number) in a data frame. Improves on the defaultbase::is.nan() function, which only works on vectors, by allowing data frames as input.

Usage

# S3 method for data.frame
is.nan(x)

# S3 method for data.frame is.nan(x)

Value

A logical matrix of the same dimensions as x, with TRUE

for cells containing NaN and FALSE otherwise

A matrix of the same dimension as x, with TRUE/FALSE values for whether each cell in the original data frame is a number or not.

Arguments

x

A data.frame object.

Examples

Run this code
df <- data.frame(
  a = c(1, 2, NaN),
  b = c(NaN, 5, 6)
)
is.nan(df)

Run the code above in your browser using DataLab