[R] Fwd: ts.intersect bug?

Gabor Grothendieck ggrothendieck at gmail.com
Wed Sep 21 16:48:31 CEST 2005


On 9/21/05, Antonio, Fabio Di Narzo <antonio.fabio at gmail.com> wrote:
> ---------- Forwarded message ----------
> From: Antonio, Fabio Di Narzo <antonio.fabio at gmail.com>
> Date: 21-set-2005 15.34
> Subject: Re: [R] ts.intersect bug?
> To: Martin Maechler <maechler at stat.math.ethz.ch>
>
>
> 2005/9/21, Martin Maechler <maechler at stat.math.ethz.ch>:
> > >>>>> "AntonioFDN" == Antonio, Fabio Di Narzo <antonio.fabio at gmail.com>
> > >>>>>     on Wed, 21 Sep 2005 13:59:26 +0200 writes:
> >
> >     AntonioFDN> This code gives an error:
> >
> >     AntonioFDN> a <- ts(1:10, start=0, freq=10)
> >     AntonioFDN> b <- ts(1:10, start=1, freq=10)
> >     AntonioFDN> ts.intersect(a,b)
> >
> > No, it gives a *warning* and returns NULL.
>
> Ooops, bad example.
> Try this instead:
> a <- ts(runif(6500), start=0, freq=10)
> b <- lag(a, 1)
> c <- ts.intersect(a, b)
>
> Gives an error from .cbind.ts

A workaround would be to convert both a and b to zoo class,
intersect them using zoo's merge and convert back to ts:

library(zoo)
z <- as.ts(merge(as.zoo(a), as.zoo(b), all = FALSE))

Regarding your other question,

Sys.putenv(LANGUAGE="en")

will result in error messages in English.




More information about the R-help mailing list