[R] Results of applying na.omit on zoo object

Rich Shepard rshepard at appl-ecosys.com
Mon Sep 19 18:48:43 CEST 2011


   I read in ?na.omit that it returns the object with incomplete cases
removed. I interpret this to mean that any zoo object row where any column
shows 'NA' will be removed from the data set.

   That's not what I need, since the 'NA' represents information in my
context. However, what I would like to do is eliminate the rows where every
column is 'NA'. When I aggregate two factors by date in the zoo object, the
rows being with the earliest possible date even if that's not appropriate
for the row factor pair.

   Is there a way to omit only those rows where all columns contain 'NA'?

Rich



More information about the R-help mailing list