R functions – na.omit – dropping rows with missing data

Continuing our series on cleaning up R data frames with missing values, we come to the na omit function. This is probably the easiest way to purge your r data frame of incomplete data.

na.omit() – remove rows with missing values

Usage is simple. Pass the data frame you want to evaluate to na.omit() and it will return a list without any rows that contain NA values.

# na.omit in R example
completerecords <- na.omit(datacollected)

Alternative approaches: