Or try:

xtsSeries <- xts(vValues, as.POSIXct(vInSeconds, origin="1970-01-01"));

en voila ;)



On Thu, Jan 13, 2011 at 6:53 AM, Gabor Grothendieck <[email protected]
> wrote:

> On Wed, Jan 12, 2011 at 10:49 PM, BSanders <[email protected]> wrote:
> >
> >
> > I have missing data in my time series, but I have the appropriate date.
>  How
> > do I pass on the time index to R?
> >
> > For example, my days look like this
> > "291 292 293 295 296 297"    (I'm missing 294)
>
> Try this:
>
> > library(zoo)
> > v <- c(291, 292, 293, 295, 296, 297)
> > z <- as.zoo(as.ts(zoo(v, v)))
> > z
> 291 292 293 294 295 296 297
> 291 292 293  NA 295 296 297
> >
> >
> > time(z)
> [1] 291 292 293 294 295 296 297
> > coredata(z)
> [1] 291 292 293  NA 295 296 297
>
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>
> _______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>



-- 
Ulrich Staudinger
[email protected]
http://www.activequant.org

        [[alternative HTML version deleted]]

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should 
go.

Reply via email to