Am 15.02.2018 um 22:24 schrieb oleg_komashko(a)ukr.net:
Dear All.
Sometimes one needs to save R data,
say 'data.frame', 'ts' or 'mts' object
in .gdt formate from inside R session
So, hopefully, the script below will be useful
for some participants
<R> #installation of the mentioned packages is required"
library(Rgretl)
library(fpp)#only as exemplary data set
air <- window(ausair, start=1990)# ts for not dealing with large data
sets as example
gr.script <- "store \"/home/oleh/gretl/rair\""
run_grcli(gr.script,data =air)
<R>
Thanks Oleh. You are the author of Rgretl, right? And so I guess that
the run_grcli function/command was also done by you.
The example is already very easy, but perhaps it might be useful to have
an explicit wrapper for this. What I mean is that a new Rgretl function,
say 'store_gretl' or 'gretl.store', executes your example.
So the following would be equivalent to your example:
<R>
library(Rgretl)
... <define air data>...
store_gretl("/home/oleh/gretl/rair", data = air)
</R>
And perhaps the fname could even get a default? Perhaps something like
"$HOME/<dataname>.gdt". Or if the R session has already been started
from gretl, and thus the variable gretl.dotdir is defined in R, then
this could be used as the path.
Just a thought.
cheers,
sven