[Gretl-users] 'store' issues
Sven Schreiber
svetosch at gmx.net
Fri Dec 15 18:25:19 EST 2006
Allin Cottrell schrieb:
> On Fri, 15 Dec 2006, Sven Schreiber wrote:
>>
>> * store saves data in ~, even though ~/gretl is activated in prefs
>
> The notion is that "store" is an "expert" command: the filename used is
> exactly what you type on the command line, so if it's not an absolute
> path it goes into the present working directory. This should be
> documented, no doubt.
Which (environment?) variable determines that directory then? Or related
to that: How can I find out in a script where the user directory (which
is set in gretl's preferences) is to use that value?
>
>> * with data from example file data2-3.gdt (annual), store saves dates
>> as literally "'1995" (including the double quotes); reopening works
>> fine, but why all these quotes, including the single quote?
>
> This may be redundant with annual data, but as I recall it's an attempt
> to avoid breakage when saving, e.g., quarterly or monthly data for use
> in a spreadsheet. Excel will do weird and wonderful things with, say,
> "1975:01", unless a single quote is prepended to indicate that it's a
> literal string.
Well gretl isn't entirely consistent here; consider what a 'store
test.csv LRM --csv' gives me for the quarterly Danish example data:
obs,LRM
"1974Q1",11.63255023
"1974Q2",11.60415248
"1974Q3",11.58152067
"1974Q4",11.60184741
"1975Q1",11.58630490
<etc.>
I have two problems with that:
1) Ok, "1974Q1" is a string and thus comes with quotes. But so are "obs"
and "LRM", yet they don't have quotes around them.
2) For annual data you get "'1960" as a spreadsheet workaround, but for
quarterly you don't get the single quote. Actually, although I
understand your Excel argument for stuff with a ":" in it, I don't
understand why that would be relevant for simple year integers in annual
data.
All this makes parsing gretl's csv files error-prone IMHO. I propose to
do one of the following two things: Either enclose _all_ strings in
double quotes, and have the enclosed-but-leading single quote for all
date values; (X)OR remove _all_ quotes, and change the separator ':' to
'M', 'W', 'D' according to the data frequency, in analogy to the 'Q' for
quarterly data. What do you think?
>
>> * gui importing from csv seems to presuppose .csv extension, must use
>> ascii import for csv files with different extension -- is that necessary?
>
> No, probably not.
Then I would suggest to mimic the behavior of ASCII import, or possibly
merge them anyway, just like in the 'open' command.
>
>> * 'open' seems to rely on heuristics only; why no possibility to
>> specify e.g. --csv as in store?
>
> Because, generally speaking, gretl is smarter than most users when it
> comes to figuring out the format of imported data! ;-) But seriously,
> what useful information could you give gretl by saying "--csv"? Gretl
> will have to check the format of the data anyway.
Ok, I take your point, until gretl screws up, then I will come back to
you ;-)
thanks,
sven
More information about the Gretl-users
mailing list