na.contiguous.zoo() will return the longest stretch of non-NA data.
Its a zoo method of the na.contiguous generic in the core of R.
rle(!is.na(rowSums(coredata(z)))) will find all stretches.
On Fri, Jul 18, 2008 at 6:47 AM, stephen sefick <ssefick at gmail.com>
wrote:> I have a data frame that is 122 columns and 70000ish rows it is a zoo
> object, but could be easily converted or read in as something else. It is
> multiparameter multistation water quality data - there are a lot of NA s.
I
> would like to find "chuncks" of data that are free of NA s to do
some
> analysis. All of the data is numeric. Is there a way besides graphing to
> find these NA less "chuncks". I did not include data because of
the size of
> the data frame, and because I don't know exactly how to tackle this
> problem. I will send a subset of the data to the list if requested and
when
> I get to work. As for reproducible code I am not entirly sure how to go
> about this, so that too is missing.
> Sorry for breaking the rules this early in the morning,
>
> Stephen
>
> --
> Let's not spend our time and resources thinking about things that are
so
> little or so large that all they really do for us is puff us up and make us
> feel like gods. We are mammals, and have not exhausted the annoying little
> problems of being mammals.
>
> -K. Mullis
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>