Select rows from a data frame where any variable is not NA

Possible duplicate:
Delete empty lines of data file in R

Suppose I have a dataframe df

I would like to select rows from it, where any of the variables in the row are not NA . That is, I only want to exclude the rows where all the NA variables are in

+6
source share
1 answer
 df[apply(!is.na(df), 1, any), ] 
+12
source

Source: https://habr.com/ru/post/919740/


All Articles