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>
# do not use $workdir or similar, use full pathes
# change for your favourite dir!!
Oleh