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

John Kane jrkrideau at yahoo.ca
Fri May 13 16:15:32 CEST 2011



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

> From: Vickie S <isvik at live.com>
> Subject: [R] Quick question: Omitting rows and cols with certain percents of missing values
> To: r-help at r-project.org
> Received: Friday, May 13, 2011, 9:42 AM
> 
> Hi
> naive question. 
> It is possible to get R command for omitting rows or col
> with missing values present. 

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]



> But
> if i want to omit rows or cols with i.e . >20% missing> values, 
> could´t find any package-based command, probably because
> it is to
> simple for anyone to do that manually, though not for me.
> Can anyone
> please help me ?
> 
> - vickie
I'd have to think about this. Hopefully a guru can come up with something quickly.




More information about the R-help mailing list