Thanks genius
• 0 views
•
link
How to select rows which has NA in any column in the dataframe in R?
for example:
you can use the
library(dplyr)
data %>%
filter_all(any_vars(is.na(.)))
We could negate complete.cases:
data[ !complete.cases(data), ]
No NAs:
data[rowSums(apply(data,1,is.na)) == 0,]
Any NAs:
data[rowSums(apply(data,1,is.na)) > 0,]
Log in to answer this question.