These generic functions are useful for dealing with
NAs in e.g., data frames.
na.fail returns the object if it does not contain any missing values, and signals an error otherwise.
na.omit returns the object with incomplete cases removed.
na.pass returns the object unchanged.
na.fail(object, ...) na.omit(object, ...) na.exclude(object, ...) na.pass(object, ...)
- an R object, typically a data frame
- further arguments special methods could require.
At present these will handle vectors, matrices and data frames comprising vectors and matrices (only).
na.omit removes cases, the row numbers of the cases form the
"na.action" attribute of the result, of class
na.exclude differs from
na.omit only in the class of the
"na.action" attribute of the result, which is
"exclude". This gives different behaviour in functions making use of
na.exclude is used the residuals and predictions are padded to the correct length by inserting
NAs for cases omitted by
Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.
Documentation reproduced from R 3.0.2. License: GPL-2.