Skip to content
Prev 9614 / 12125 Next

[R-pkg-devel] R_orderVector1 - algo: radix, shell, or another?

? Sun, 24 Sep 2023 10:38:41 +0200
Jan Gorecki <j.gorecki at wit.edu.pl> ?????:
The body of the sorting algorithm is defined in the sort2_with_index
macro. This is shell sort. (I don't actually recognise sorting
algorithms on sight, but the "sincs" array gave it away:
<https://discourse.julialang.org/t/ironic-observation-about-sort-and-sortperm-speed-for-small-integers-vs-r/8715/3>.)
No easy ones, I think. You could construct a call to order(..., method
= 'radix') from R or bundle a sort implementation of your own.

These are all undocumented implementation details. They could change in
a new version of R (although quite a lot of it hasn't changed in 11-22
years). Why are you looking for specific sorting algorithms? Could
there be a better way to solve your problem?