Dear all, I want to create a time series object from 00:00:00 to 23:59:00 without dates ? I can't figure it out with xts ? ce
Joshua Ulrich
2014-Dec-21 05:53 UTC
[R] How to create a time series object with time only (no date)
On Dec 20, 2014 11:11 PM, "ce" <zadig_1 at excite.com> wrote:> > > Dear all, > > I want to create a time series object from 00:00:00 to 23:59:00 withoutdates ?> I can't figure it out with xts ? >You can't create an xts object without a date in the index. If the date doesn't matter, you can just set it to 1970-01-01 (or any other day).> ce > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]
Gabor Grothendieck
2014-Dec-21 20:50 UTC
[R] How to create a time series object with time only (no date)
On Sun, Dec 21, 2014 at 12:09 AM, ce <zadig_1 at excite.com> wrote:> > Dear all, > > I want to create a time series object from 00:00:00 to 23:59:00 without dates ? > I can't figure it out with xts ? >This uses zoo, rather than xts: library(zoo) library(chron) tt <- seq(times("00:00:00"), times("23:59:00"), by = times("00:01:00")) dat <- 1:1440 z <- zoo(dat, tt) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com