[R] subsetting with NA's

Ko-Kang Kevin Wang Ko-Kang at xtra.co.nz
Mon Apr 8 13:19:56 CEST 2002


----- Original Message -----
From: "David Kane <David Kane" <a296180 at mica.fmr.com>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, April 08, 2002 10:38 PM
Subject: [R] subsetting with NA's


> without having to write:
>
> x[! is.na(x$b) & ! is.na(x$c) & ! is.na(x$d) & x$b < 3 & x$c > 5 & x$d >
100,]
>
> Is there a trick for achieving this, for ignoring all NA's during
subsetting?

Have you tried na.omit()?

Kevin



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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