[R] how to skip NA columns ?
Czerminski, Ryszard
ryszard at arqule.com
Thu Jun 20 13:58:17 CEST 2002
R-helpers!
na.omit() can be used to remove rows with NA's
but how can I remove columns ? and remember, which columns have been removed
?
I guess I can do t(na.omit(t(o))) as shown below, but this probably creates
a lot of overhead and I do not know which columns
have been removed.
Yours,
R
> o
[,1] [,2] [,3]
[1,] 1 NA 7
[2,] 2 NA 8
[3,] 3 NA 9
> t(na.omit(t(o)))
[,1] [,2]
[1,] 1 7
[2,] 2 8
[3,] 3 9
Ryszard Czerminski phone: (781)994-0479
ArQule, Inc. email:ryszard at arqule.com
19 Presidential Way http://www.arqule.com
Woburn, MA 01801 fax: (781)994-0679
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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