powered by
NA
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)).
which(!complete.cases(x))
naRows(x, inf = FALSE, inverse = FALSE)
Integer vector.
Data frame or matrix.
Logical, if TRUE then also return row numbers of rows in which at least one element is Inf or -Inf. The default is FALSE.
TRUE
Inf
-Inf
FALSE
Logical, if TRUE then return row numbers of rows that do not have NAs (and possibly Inf or -Inf). The default is FALSE.
x <- data.frame(a=1:5, b=c(1, 2, NA, 4, 5), c=c('a', 'b', 'c', 'd', NA)) naRows(x)
Run the code above in your browser using DataLab