complete.cases

0th

Percentile

Find Complete Cases

Return a logical vector indicating which cases are complete, i.e., have no missing values.

Keywords
logic, NA
Usage
complete.cases(...)
Arguments
...
a sequence of vectors, matrices and data frames.
Value

A logical vector specifying which observations/rows have no missing values across the entire sequence.

See Also

is.na, na.omit, na.fail.

Aliases
  • complete.cases
Examples
library(stats) x <- airquality[, -1] # x is a regression design matrix y <- airquality[, 1] # y is the corresponding response stopifnot(complete.cases(y) != is.na(y)) ok <- complete.cases(x, y) sum(!ok) # how many are not "ok" ? x <- x[ok,] y <- y[ok]
Documentation reproduced from package stats, version 3.2.2, License: Part of R 3.2.2

Community examples

Looks like there are no examples yet.