On Mon, 5 Oct 2020, Allin Cottrell wrote:
On Mon, 5 Oct 2020, Riccardo (Jack) Lucchetti wrote:
> On Mon, 5 Oct 2020, Artur Tarassow wrote:
>
>> if I am not missing any side effects, making nelem() to work for scalar
>> values seems to be a reasonable approach.
>
> Excellent idea, now in git.
>
> If Allin approves, I'll update the docs.
The change in git looks fine to me. But is a doc update really needed?
I think it is.
A user would surely never knowingly call nelem() on a scalar. Now, if
you call it on an object which could be a matrix but is in fact a scalar
you get the right answer. That's good, but I tend to think it's enough.
Well, I thought that it'd be nice if the description of nelem() mentioned
the fact that this function is the preferred way of inferring the "size"
of an object, including scalars. In fact, we could make nelem()
functionally equivalent to nobs() for series.
-------------------------------------------------------
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
-------------------------------------------------------