[R] [zoo] - Individual zoo or data frames from non-continuous zoo series

stephen sefick ssefick at gmail.com
Thu Jan 6 23:41:52 CET 2011


#Is there a way to break the below zoo object into non-NA data frames
algorithmically
#this is a small example of a much larger problem.
#It is really no even necessary to have the continuous chunks
#end up as zoo objects but it is important to have them end
#up with the index column.
#thanks for all of your help in advance, and
#if you need anything else please let me know

library(zoo)

ind. <- 1:200
data <- c(1:50, rep(NA, 50), 1:50, rep(NA, 50))

z <- zoo(data, ind.)

-- 
Stephen Sefick
____________________________________
| Auburn University                                   |
| Department of Biological Sciences           |
| 331 Funchess Hall                                  |
| Auburn, Alabama                                   |
| 36849                                                    |
|___________________________________|
| sas0025 at auburn.edu                             |
| http://www.auburn.edu/~sas0025             |
|___________________________________|

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

"A big computer, a complex algorithm and a long time does not equal science."

                              -Robert Gentleman



More information about the R-help mailing list