Filter Missing Values From a Data Frame

DESCRIPTION:
Filters out missing values (na.omit), or causes an error if missing values are encountered (na.fail).

USAGE:
na.omit(frame)
na.fail(frame)

REQUIRED ARGUMENTS:
frame:
a data frame.

VALUE:
a data frame, consisting of the rows of frame for which none of the variables had any missing values. Variables that act like matrices (that is, that have a dimension attribute of length 2) will be examined column-by-column. All other variables will be treated as vectors. Variables of non-atomic mode are ignored.

SIDE EFFECTS:
na.fail causes an error if missing values are present.

DETAILS:
These functions may be given to model fitting functions such as lm via their na.action argument.

SEE ALSO:
na.gam.replace , na.include , na.tree.replace .

EXAMPLES:
Tm <- na.omit(claims)
dim(Tm)
  [1] 123   5
dim(claims)
  [1] 128   5
## How to find which rows were omitted ##
used <- match(row.names(claims), row.names(Tm))
omitted <- seq(nrow(claims))[is.na(used)]
omitted
  [1] 12 15 16 32 80