Answers for "find row with na r"

R
0

find row with na r

# Never use =='NA' to test for missing values. Use is.na() instead. This should do it:
new_DF <- DF[rowSums(is.na(DF)) > 0,]

# or in case you want to check a particular column, you can also use
new_DF <- DF[is.na(DF$Var),]

#In case you have NA character values, first run
Df[Df=='NA'] <- NA
Posted by: Guest on November-22-2021

Browse Popular Code Answers by Language