[R] Subsets without NA

Grum, Mikkel M.GRUM at CGIAR.ORG
Tue Jan 8 12:09:09 CET 2002


Is there a way of removing all rows with missing values from a data frame?
I usually use 
subset(x, var1!="NA") 
and repeat for each variable.  It would be nice to be able to do it in one
fell swoop.  Also, surprisingly, it doesn't always work.  Sometimes I'm left
with an empty set even though not all rows have missing values for the
variable.

Cheers,
mikkel





Mikkel Grum, PhD
Genetic Diversity Scientist
International Plant Genetic Resources Institute (IPGRI)
Sub-Saharan Africa Group
***
c/o ICRAF
PO Box 30677 Nairobi, Kenya
Tel: 254 2 524505 / 524500
Fax: 254 2 524501 / 524001
m.grum at cgiar.org
ipgri-kenya at cgiar.org
www.ipgri.cgiar.org

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list