On Mon, Sep 19, 2011 at 8:34 PM, Rich Shepard <rshep...@appl-ecosys.com> wrote: > On Mon, 19 Sep 2011, Gabor Grothendieck wrote: > >> names(z) gives the column names of zoo object z. > >> # get a list of date ranges >> lapply(1:ncol(z), function(i) range(time(na.omit(z[, i])))) >
If z has column names (but do not use this if it does not) then the following improvement will display them in the output: > sapply(names(z), function(nm) range(time(na.omit(z[, nm]))), simplify = FALSE) $a [1] "2011-09-21" "2011-09-23" $b [1] "2011-09-22" "2011-09-24" -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ R-help@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.