On Thu, 14 Sep 2017, Allin Cottrell wrote:
On Thu, 14 Sep 2017, oleg_komashko(a)ukr.net wrote:
[...]
> As for me, the most tedious thing
> with Main/Tools/Start GNU R
> are time series
> In this case class(gretldata)->"mts"
>
> That's why I never use Tools/Start GNU R
> with time series: instead I run the following
> R script from gretl
> <R
> # choose interactive R session
> if (any(class(gretldata)!="data.frame"))
> {mts2frame2<-function(x)
> {ddd<-data.frame(x);
> if (length(class(x))>1)
> {m<-ncol(x);for (i in 1:m)
> ddd[,i]<-ts(ddd[,i],start=start(x),frequency=frequency(x))}
> else
> ddd[,1]<-ts(ddd[,1],start=start(x),frequency=frequency(x));
> ddd};
> gretldata<-mts2frame2(gretldata)}
>
> # make native gretl variables names searcheable
> attach(gretldata)
> R>
Is that the general opinion? That is, that R's multiple time series object
("mts") is of no use and we're better creating a data frame and copying the
time-series attributes across per series.
If so, we could easily revise our R-data exporter to do just that for time
series datasets.
Personally, I have a totally different opinion from Oleh's. I like the
fact that we ship time-series data into R as a ts(), as opposed to a
generic data frame.
But, that said, I'm not a heavy R user, so I'd rather listen to more
informed people than myself.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------