[Gretl-devel] Feature request for sorting of variables

andreas.rosenblad at ltv.se andreas.rosenblad at ltv.se
Wed Oct 3 07:51:08 EDT 2007

I would appreciate a gretl command where the values of all variables in a
data set is sorted in ascending or descending order by one of the
variables, and one then can save the data set with the new sorted ordering.

I know that it is possible to use e.g.

anew = sortby(b,a)
bnew = sort(b)
a = anew
b = bnew
delete anew bnew

to sort in ascending order, but it is tedious when one have many variables.

It would be easier with a command e.g. sortallby(b) and dsortallby(b) that
sorts the values of all variables at the same time by increasing or
decreasing values of some of the variables.

Best regards

More information about the Gretl-devel mailing list