Answers for "find rows with column values in r"

C
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
-1

select number of row dataframe r

df <- df[1:5,]
Posted by: Guest on April-03-2021

Code answers related to "find rows with column values in r"

Code answers related to "C"

Browse Popular Code Answers by Language