Omit rows containing specific column of NA

前端 未结 8 1160
感动是毒
感动是毒 2020-11-27 10:39

I want to know how to omit NA values in a data frame, but only in some columns I am interested in.

For example,

DF <- data.frame(x =          


        
8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 11:02

    Hadley's tidyr just got this amazing function drop_na

    library(tidyr)
    DF %>% drop_na(y)
      x  y  z
    1 1  0 NA
    2 2 10 33
    

提交回复
热议问题