Hi,
this question is prompted by the very recent tip for the aggregate()
function that the position of the count column is at nelem(byvar) + 1.
(Where the "byvar" name stems from the help text.)
I realized that this will fail if the byvar argument is only a single
series.
For example:
<hansl>
open denmark
list L1 = LRM
eval nelem(L1) # 1, of course
eval nelem(LRM) # data type error
</hansl>
I understand that nelem() on a series is ambiguous, because it could be
understood to mean the observations, like in nelem({x}). But we also
have the nobs() function for that.
I wonder if this issue may become more relevant with the recent
overloaded "numeric" argument possibility? Maybe also the other way
around, in that nelem(x) should become an alias for nobs(x) for a series
because of that? Hm.
(BTW, the nelem doc needs updating, because it also works for a string.)
thanks
sven