I want to remove the lines from a data.table that only contain NAs.
> tab = data.table(A = c(1, NA, 3), B = c(NA, NA, 3)) > tab A B 1: 1 NA 2: NA
I quite like
tab <- tab[sapply(1:nrow(tab), function(i){!all(is.na(tab[i,]))}),]
It is intuitive to me, but I'm not sure it is the fastest approach.
HTH