Am 13.07.2021 10:40 schrieb Sven Schreiber:
Am 13.07.2021 um 09:39 schrieb atecon:
> <hansl>
> matrix m = {NA; NA}
> eval uniq(m)
>
> ? eval uniq(m)
> Data error
> </hansl>
>
> The doc is silent about the case when all entries of the column are
> NA.
> I am a bit surprised that this leads to a data error and hence full
> stop. What about returning an empty matrix in this case?
Sounds good to me.
I just see that this is a "structural" issue. The same applies also for
quantile() (and probably many more functions):
<hansl>
matrix m1 = {1, NA; 3, NA}
matrix m2 = {1, -1; 3, -3}
eval quantile(m2, 0.5)
eval quantile(m1, 0.5)
? eval quantile(m2, 0.5)
2 -2
? eval quantile(m1, 0.5)
Data error
Error executing script: halting
eval quantile(m1, 0.5)
</hansl>
>
> Actually, the same "error" applies to the value() function.
(For the record, it's values().)
True.
Artur