R Data Analysis Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How to do it...

To get a data frame that has only the cases with no missing values for any variable, use the na.omit() function:

> dat.cleaned <- na.omit(dat) 

Now dat.cleaned contains only those cases from dat that have no missing values in any of the variables.