lag() bug on output units
Yohan Chalabi
chalabi at phys.ethz.ch
Mon Oct 24 10:53:53 CEST 2011
On 17 oct. 2011, at 12:27, Daniele Amberti wrote:
> # final result gives
> ## S.1[-1] S.2[0] S.3[1] S.1[-1] S.2[0] ...
> # but should be
> ## S.1[-1] S.1[0] S.1[1] S.2[-1] S.2[0] …
Hi Daniele,
Thanks for the report,
I have just committed a patch to R-forge that fixes the problem.
Regards,
Yohan
>
>
> library(timeSeries) # 2130.92 on R 2.12.2
> set.seed(1953)
> data <- matrix(runif(18), ncol = 3)
> charvec <- rev(paste("2009-0", 1:6, "-01", sep = ""))
> S <- timeSeries(data, charvec)
> colnames(S) <- paste("S", 1:3, sep = ".")
>
> #GMT
> # S.1 S.2 S.3
> #2009-06-01 0.5087459 0.5740212 0.9310609
> #2009-05-01 0.4770248 0.5736546 0.3990106
> #2009-04-01 0.1829114 0.5912718 0.8642168
> #2009-03-01 0.4472982 0.9652389 0.6135854
> #2009-02-01 0.6602838 0.5931596 0.4981308
> #2009-01-01 0.2228321 0.2319316 0.2083319
>
> lag(S, -1:1)
>
> #GMT
> # S.1[-1] S.2[0] S.3[1] S.1[-1] S.2[0] ...
> #2009-06-01 0.4770248 0.5087459 NA 0.5736546 0.5740212 ...
>
> ________________________________
>
> ORS Srl
>
> Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
> Tel. +39 0173 620211
> Fax. +39 0173 620299 / +39 0173 433111
> Web Site www.ors.it
>
> ------------------------------------------------------------------------------------------------------------------------
> Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati è vietato e potrebbe costituire reato.
> Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se provvedesse alla distruzione dello stesso
> e degli eventuali allegati.
> Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non siano relative alle attività e/o
> alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla società stessa, né la impegnano in alcun modo.
> _______________________________________________
> Rmetrics-core mailing list
> Rmetrics-core at r-project.org
> https://stat.ethz.ch/mailman/listinfo/rmetrics-core
More information about the Rmetrics-core
mailing list