On Sat, 26 Dec 2020, Allin Cottrell wrote:
On Sat, 26 Dec 2020, Sven Schreiber wrote:
>
> I think the observation numbers or markers were also wanted. Perhaps
> like this:
> <hansl>
> open AWM
> # show biggest 5 values
> series date = $obsdate
> list L = GCR_YER date
> eval mreverse(msortby({L}, 1)[1:5,])
> </hansl>
>
> But the number format of the date is not adequate there.
So:
<hansl>
open AWM
m = mreverse(msortby({obs, GCR_YER},2))[1:5,]
strings S = array(5)
loop i=1..5
S[i] = obslabel(m[i,1])
endloop
rnameset(m, S)
print m
</hansl>
New in git, obslabel() supports a vector argument, so this is a bit
less hassle:
<hansl>
open AWM
m = mreverse(msortby({obs, GCR_YER},2))[1:5,]
rnameset(m, obslabel(m[,1]))
printf "%10g\n", m
</hansl>
Allin