
Last chance! 50% off unlimited learning
Sale ends in
complete.cases(...)
is.na
,
na.omit
,
na.fail
.
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]
Run the code above in your browser using DataLab