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

2011-09-19 Thread Gabor Grothendieck
On Mon, Sep 19, 2011 at 7:52 PM, Marc Schwartz wrote: > Hi Rich, > > On Sep 19, 2011, at 5:18 PM, Rich Shepard wrote: > >> On Mon, 19 Sep 2011, Marc Schwartz wrote: >> >>> Let me start by acknowledging that I have little practical experience in >>> time series analyses, much less proficiency with

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

2011-09-19 Thread Gabor Grothendieck
On Mon, Sep 19, 2011 at 7:42 PM, Marc Schwartz wrote: > > On Sep 19, 2011, at 5:06 PM, Gabor Grothendieck wrote: > >> On Mon, Sep 19, 2011 at 5:33 PM, Marc Schwartz wrote: >>> On Sep 19, 2011, at 4:00 PM, Rich Shepard wrote: >>> On Mon, 19 Sep 2011, Marc Schwartz wrote: >> Is there

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Marc Schwartz wrote: Having a better idea of your domain, you might want to consider looking at the r-sig-ecology list as a supplement to R-help: https://stat.ethz.ch/mailman/listinfo/r-sig-ecology Done. Thanks. Rich -- Richard B. Shepard, Ph.D. | Integrit

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

2011-09-19 Thread Gabor Grothendieck
On Mon, Sep 19, 2011 at 7:42 PM, Marc Schwartz wrote: > > On Sep 19, 2011, at 5:06 PM, Gabor Grothendieck wrote: > >> On Mon, Sep 19, 2011 at 5:33 PM, Marc Schwartz wrote: >>> On Sep 19, 2011, at 4:00 PM, Rich Shepard wrote: >>> On Mon, 19 Sep 2011, Marc Schwartz wrote: >> Is there

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

2011-09-19 Thread Marc Schwartz
Hi Rich, On Sep 19, 2011, at 5:18 PM, Rich Shepard wrote: > On Mon, 19 Sep 2011, Marc Schwartz wrote: > >> Let me start by acknowledging that I have little practical experience in >> time series analyses, much less proficiency with the zoo package. I just >> don't come across them much in clinic

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

2011-09-19 Thread Marc Schwartz
On Sep 19, 2011, at 5:06 PM, Gabor Grothendieck wrote: > On Mon, Sep 19, 2011 at 5:33 PM, Marc Schwartz wrote: >> On Sep 19, 2011, at 4:00 PM, Rich Shepard wrote: >> >>> On Mon, 19 Sep 2011, Marc Schwartz wrote: >>> > Is there a way to omit only those rows where all columns contain 'NA'? >

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Gabor Grothendieck wrote: For accurate information on the design of zoo read vignette("zoo-design") and the other four vignettes and as well as the help files in the zoo package. Gabor, That's what I've done today. Haven't totally absorbed everything but I do have a m

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Marc Schwartz wrote: Let me start by acknowledging that I have little practical experience in time series analyses, much less proficiency with the zoo package. I just don't come across them much in clinical trials/studies, at least the ones that I have been involved with ove

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

2011-09-19 Thread Gabor Grothendieck
On Mon, Sep 19, 2011 at 5:33 PM, Marc Schwartz wrote: > On Sep 19, 2011, at 4:00 PM, Rich Shepard wrote: > >> On Mon, 19 Sep 2011, Marc Schwartz wrote: >> Is there a way to omit only those rows where all columns contain 'NA'? >> >>> You can look at ?complete.cases for one approach, presuming

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

2011-09-19 Thread Marc Schwartz
On Sep 19, 2011, at 4:00 PM, Rich Shepard wrote: > On Mon, 19 Sep 2011, Marc Schwartz wrote: > >>> Is there a way to omit only those rows where all columns contain 'NA'? > >> You can look at ?complete.cases for one approach, presuming that it will >> work on zoo objects. > > Marc, > > Do I ev

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Marc Schwartz wrote: Is there a way to omit only those rows where all columns contain 'NA'? You can look at ?complete.cases for one approach, presuming that it will work on zoo objects. Marc, Do I even need to worry about these NAs? Thanks to Gabor I have a data fra

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Achim Zeileis wrote: This should do what you want, I think: R> z <- zoo(matrix(1:8, ncol = 2), Sys.Date() + 0:3) R> z[2,2] <- NA R> z[3,] <- NA R> z 2011-09-19 1 5 2011-09-20 2 NA 2011-09-21 NA NA 2011-09-22 4 8 R> z[!apply(is.na(z), 1, all),] 2011-09-19 1 5 2011-0

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

2011-09-19 Thread Marc Schwartz
On Sep 19, 2011, at 12:19 PM, Marc Schwartz wrote: > > On Sep 19, 2011, at 12:14 PM, Marc Schwartz wrote: > >> >> On Sep 19, 2011, at 12:01 PM, Rich Shepard wrote: >> >>> On Mon, 19 Sep 2011, Marc Schwartz wrote: >>> You can look at ?complete.cases for one approach, presuming that it wi

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

2011-09-19 Thread Marc Schwartz
On Sep 19, 2011, at 12:01 PM, Rich Shepard wrote: > On Mon, 19 Sep 2011, Marc Schwartz wrote: > >> You can look at ?complete.cases for one approach, presuming that it will >> work on zoo objects. > > Marc, > > That's the opposite of what I want. It returns only rows with no missing > data. I'

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

2011-09-19 Thread Achim Zeileis
On Mon, 19 Sep 2011, Rich Shepard wrote: On Mon, 19 Sep 2011, Marc Schwartz wrote: You can look at ?complete.cases for one approach, presuming that it will work on zoo objects. Marc, That's the opposite of what I want. It returns only rows with no missing data. I'm looking for something th

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Marc Schwartz wrote: You can look at ?complete.cases for one approach, presuming that it will work on zoo objects. Marc, That's the opposite of what I want. It returns only rows with no missing data. I'm looking for something that will return rows with _only_ missing da

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Marc Schwartz wrote: You can look at ?complete.cases for one approach, presuming that it will work on zoo objects. Marc, I'll read and try it. Can't hurt anything. Thanks, Rich __ R-help@r-project.org mailing list https://s

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

2011-09-19 Thread Marc Schwartz
On Sep 19, 2011, at 11:48 AM, Rich Shepard wrote: > 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' represe

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

2011-09-19 Thread Rich Shepard
On Mon, 19 Sep 2011, Rich Shepard wrote: When I aggregate two factors by date in the zoo object, the rows being ... ^ That should be 'begin'. Mea culpa! Rich __ R-help@r-proj

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

2011-09-19 Thread Rich Shepard
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