To rearrange sequence data
|
var val, vSortIndex, vNewData;
val = c(c("2", "8", "4"), c("1","2","1"))
//To sort the first dimension of "val" in ascending numerical order, specify as follows.
vSortIndex = ::SortValue(val[0, ], "number", F);
//The indexes resulting from sorting using the above sorting criteria are returned in a one-dimensional array in "vSortIndex".
//As shown below, you can obtain the sorted result of the array by specifying the returned value "vSortIndex" as the original data array "val".
vNewData = val[ , vSortIndex];
|
vNewData will store the sorted "c(c("2", "4", "8"), c("1","1","2"))".
If you have multiple sort keys, use the SortTable method.
|