Skip to content
Prev 259763 / 398502 Next

Quick question: Omitting rows and cols with certain percents of missing values

--- On Fri, 5/13/11, Vickie S <isvik at live.com> wrote:

            
http://tolstoy.newcastle.edu.au/R/help/04/11/6887.html
Slightly adapted

(mydata  <- data.frame(matrix(c(1,2,3,4,5,6,7,8, NA),3)))
 mydata[apply(mydata, 1, function(x)!any(is.na(x))), , drop=TRUE]
I'd have to think about this. Hopefully a guru can come up with something quickly.