[Gretl-devel] array indexing

Riccardo Jack Lucchetti r.lucchetti at univpm.it
Tue Aug 22 12:12:14 EDT 2006


On Tue, August 22, 2006 15:48, Allin Cottrell wrote:
> On Tue, 22 Aug 2006, Vaidotas Zemlys wrote:
>
>> R uses 1-base indexing. If x is vector, x[1] is the first element, if m
>> is array, or matrix, or data frame, m[1,] is the first row, m[,1] is the
>> first column.
>
> Thanks.  Well then, we're not out of line with all other
> programs.  (I suppose ox is really a programming language rather
> than an "econometrics package" as such, and in programming
> languages 0-base indexing is certainly the norm.)
>

And even that, not always: IIRC, FORTRAN is 1-based too, and so should be
gauss and matlab. I think base 1 is ok, it's one less thing for people without
a C background to worry about if they want to port their procedures into gretl
scripts.

Riccardo "Jack" Lucchetti
Dipartimento di Economia
Facoltà di Economia "G. Fuà"
Ancona




More information about the Gretl-devel mailing list