On Sun, 19 May 2019, Sven Schreiber wrote:
Am 19.05.2019 um 12:21 schrieb Riccardo (Jack) Lucchetti:
> On Sat, 18 May 2019, Riccardo (Jack) Lucchetti wrote:
>
>> Answering myself: I put together a smal hansl function for doing just
>> that: it should work on reasonably regular csv files. It's reported
>> below (together with a small example): what do you guys think about
>> adding it to the extra package?
>
> Ok, I'm populating this thread all by myself, but IMO I have something
> worth looking at. Attached you'll find a file with the functions and a
> sample script. I believe this is a useful addition; if nobody objects,
> I'm going to upload for moderation a new version of extra.gfn that
> contains the new function tomorrow or Tuesday at the latest.
Hi Jack, sorry for the delay, I know the feeling of being alone in a
thread ;-)
Coming back to your original post, indeed I think it would make sense to
extend the built-in mread() function. In that sense it's not clear to me
that putting something like this into extra would be the best solution.
Related remark: Gretl already has a lot of heuristics of dealing with
csv files, which is used by the 'open' command. So basically reading in
a matrix from a csv file should be similar to doing:
clear -> open thisfile.csv - matrix m = {dataset}.
Of course you don't want to ditch the old dataset in place and start a
new session, so this is not totally equivalent. But perhaps internally
in an extended mread() function the existing backend C code could be reused.
Hmm, interesting idea. I think this could be made to work quite
nicely. Internally, nothing prevents us from creating a new,
temporary "hidden" dataset (then turning it into a matrix) without
disturbing the existing dataset or absence of dataset.
Allin