On Tue, 13 Jul 2021, atecon wrote:
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.
That's now in git: values and uniq return empty matrices given input
that's all-NAs.
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
This seems a somewhat different issue. Would you want to see a
return value of {2, nan} for m1?
Allin