naRows: Index of rows in a data frame or matrix that contain at least...

View source: R/naRows.r

naRowsR Documentation

Index of rows in a data frame or matrix that contain at least one NA

Description

This function returns the row number of any row in a data frame or matrix that has at least one NA. This is the same as which(!complete.cases(x)).

Usage

naRows(x, inf = FALSE, inverse = FALSE)

Arguments

x

Data frame or matrix.

inf

Logical, if TRUE then also return row numbers of rows in which at least one element is Inf or -Inf. The default is FALSE.

inverse

Logical, if TRUE then return row numbers of rows that do not have NAs (and possibly Inf or -Inf). The default is FALSE.

Value

Integer vector.

Examples

x <- data.frame(a=1:5, b=c(1, 2, NA, 4, 5), c=c('a', 'b', 'c', 'd', NA))
naRows(x)

adamlilith/omnibus documentation built on May 3, 2024, 9:49 a.m.