Learn R Programming

bit (version 4.5.0.1)

Sorting: Generics for in-RAM sorting and ordering

Description

These are generic stubs for low-level sorting and ordering methods implemented in packages 'bit64' and 'ff'. The ..sortorder methods do sorting and ordering at once, which requires more RAM than ordering but is (almost) as fast as as sorting.

Usage

ramsort(x, ...)

ramorder(x, i, ...)

ramsortorder(x, i, ...)

mergesort(x, ...)

mergeorder(x, i, ...)

mergesortorder(x, i, ...)

quicksort(x, ...)

quickorder(x, i, ...)

quicksortorder(x, i, ...)

shellsort(x, ...)

shellorder(x, i, ...)

shellsortorder(x, i, ...)

radixsort(x, ...)

radixorder(x, i, ...)

radixsortorder(x, i, ...)

keysort(x, ...)

keyorder(x, i, ...)

keysortorder(x, i, ...)

Value

These functions return the number of NAs found or assumed during sorting

Arguments

x

a vector to be sorted by ramsort and ramsortorder, i.e. the output of sort

...

further arguments to the sorting methods

i

integer positions to be modified by ramorder and ramsortorder, default is 1:n, in this case the output is similar to order

Index of implemented methods

genericffbit64
ramsortramsort.defaultramsort.integer64
shellsortshellsort.defaultshellsort.integer64
quicksortquicksort.integer64
mergesortmergesort.defaultmergesort.integer64
radixsortradixsort.defaultradixsort.integer64
keysortkeysort.default
genericff
bit64ramorderramorder.default
ramorder.integer64shellordershellorder.default
shellorder.integer64quickorder
quickorder.integer64mergeordermergeorder.default
mergeorder.integer64radixorderradixorder.default
radixorder.integer64keyorderkeyorder.default
generic
ffbit64ramsortorder
ramsortorder.integer64shellsortorder
shellsortorder.integer64quicksortorder
quicksortorder.integer64mergesortorder
mergesortorder.integer64radixsortorder
radixsortorder.integer64keysortorder

Author

Jens Oehlschlägel <Jens.Oehlschlaegel@truecluster.com>

Details

The sort generics do sort their argument 'x', some methods need temporary RAM of the same size as 'x'. The order generics do order their argument 'i' leaving 'x' as it was, some methods need temporary RAM of the same size as 'i'. The sortorder generics do sort their argument 'x' and order their argument 'i', this way of ordering is much faster at the price of requiring temporary RAM for both, 'x' and 'i', if the method requires temporary RAM. The ram generics are high-level functions containing an optimizer that chooses the 'best' algorithms given some context.

See Also

sort and order in base R, bitsort for faster inteer sorting