On Mon, May 30, 2022 at 9:19 PM Fred Engst <engst.uibe(a)gmail.com> wrote:
As you can see, the way I’m using gretl, I need to send my students a
.gretl dataset with all the models and perhaps graphs. As is, I need to save each dataset
manually, and it is a bit time consuming when there are more than just a few students. I
wish I can do this through a script, perhaps using gretlcli to do that, if any of you can
suggest a way.
You're talking about a gretl session file, not just a dataset (which
is easily saved via script using either the GUI program or gretlcli,
using the "store" command).
Saving a session file via gretlcli is inherently impossible since that
program has no notion of a "session", no named models or graphs.
However, saving a session file via the command-line (script or
console) in the GUI program, while it has not been possible before, is
now implemented in git and snapshots. You use the "store" command,
giving the name of the file to be saved the suffix ".gretl", as in
Note, though, that you cannot specify a list of series to save (as in
standard "store" usage) -- or if you do, the effect is to save a gretl
dataset (in the strict sense). with ".gdt" appended to whatever
filename was given. There's no provision in session-saving to subset
the existing series, though of course you can achieve that effect by
deleting some series before doing the save.
Here's a trivial example of the new usage:
m1 <- ols 1 0 2
g1 <- gnuplot price sqft