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.
This would be very nice of course, but in that case I would imagine the
job would be less straightforward than it seems, because of the intrinsic
differences between the eventual aims.
When we read a csv file into a dataset, we need to have many more checks
in place than when reading into a matrix. For example, we can just zap
strings and substitute them win NAs; or the header, if present, can
contain labels that wouldn'be allowed as indentifiers (eg empty). Or we
could allow incoherent csv structures (like in the "malformed" example in
my sample script).
The reason why I brought this up in the first place is that I realised
that a function like the one I coded in hansl would be very useful when
translating code from Octave/Matlab; of course, in some cases you will
want your script to operate on the same data as the matlab code, where
reading from csv is customarily used in a much larger set of cases that
reading data in.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------