This code gives an error: a <- ts(1:10, start=0, freq=10) b <- ts(1:10, start=1, freq=10) ts.intersect(a,b) This one works normally (and correctly): a <- ts(1:10, start=0) b <- ts(1:10, start=1) ts.intersect(a,b) Antonio, Fabio Di Narzo. P.S. How to switch off italian error messages to post on r-help?> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 1.0 year 2005 month 04 day 18 language R
>>>>> "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. Why should it not? a and b have are not overlapping, ie. *have* intersection NULL : plot(c(0,2), c(0,10), type ="n") ; lines(a); lines(b,col=2) I think you misunderstand what 'freq' means in the current context. AntonioFDN> This one works normally (and correctly): AntonioFDN> a <- ts(1:10, start=0) AntonioFDN> b <- ts(1:10, start=1) AntonioFDN> ts.intersect(a,b) AntonioFDN> Antonio, Fabio Di Narzo. AntonioFDN> P.S. How to switch off italian error messages to post on r-help? >> version AntonioFDN> _ AntonioFDN> platform i386-pc-mingw32 AntonioFDN> arch i386 AntonioFDN> os mingw32 AntonioFDN> system i386, mingw32 AntonioFDN> status AntonioFDN> major 2 AntonioFDN> minor 1.0 AntonioFDN> year 2005 AntonioFDN> month 04 AntonioFDN> day 18 AntonioFDN> language R AntonioFDN> ______________________________________________ AntonioFDN> R-help at stat.math.ethz.ch mailing list AntonioFDN> https://stat.ethz.ch/mailman/listinfo/r-help AntonioFDN> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Prof Brian Ripley
2005-Sep-21 13:29 UTC
[R] user ignored an informative warning message (was ts.intersect bug?)
On Wed, 21 Sep 2005, Antonio, Fabio Di Narzo claimed:> This code gives an error: > > a <- ts(1:10, start=0, freq=10) > b <- ts(1:10, start=1, freq=10) > ts.intersect(a,b)In reality, it gives a helpful warning:> ts.intersect(a,b)NULL Warning message: non-intersecting series in: .cbind.ts(list(...), .makeNamesTs(...), dframe = dframe, union = FALSE) Your two series have no time points in common, see> time(a)Time Series: Start = c(0, 1) End = c(0, 10) Frequency = 10 [1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9> time(b)Time Series: Start = c(1, 1) End = c(1, 10) Frequency = 10 [1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 or try> ts.union(a,b)-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
---------- 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