invalid names/units created by lag()
Yohan Chalabi
chalabi at phys.ethz.ch
Mon Oct 24 11:08:22 CEST 2011
On 19 oct. 2011, at 09:09, Daniele Amberti wrote:
> # function lag() on a timeSeries makes syntactically invalid names
> # when used with other functions from base package (e.g. merge)
> # problems arise.
> # Suggestion is to check units with function make.names().
> # make.names() restrict freedom on units but ensure compatibility.
>
>
> 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 = ".")
>
> merge(S[,2], lag(S[,1], -1:1))
>
Hi Daniele,
Thanks for the report.
You can find a new version of merge timeSeries method on R-forge which can handle such units.
Regards,
Yohan
>
>
> ________________________________
>
> 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.
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> 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