Remove rows with all or some NAs (missing values) in data.frame

后端 未结 16 1643
日久生厌
日久生厌 2020-11-21 05:49

I\'d like to remove the lines in this data frame that:

a) contain NAs across all columns. Below is my example data frame.



        
16条回答
  •  遇见更好的自我
    2020-11-21 06:00

    We can also use the subset function for this.

    finalData<-subset(data,!(is.na(data["mmul"]) | is.na(data["rnor"])))
    

    This will give only those rows that do not have NA in both mmul and rnor

提交回复
热议问题