bitsort: Low-level sorting: bit sort

View source: R/bitsort.R

bitsortR Documentation

Low-level sorting: bit sort

Description

In one pass over the vector NAs are handled according to parameter na.last by range_sortna(), then, if the vector is unsorted, bit sort is invoked.

Usage

bitsort(x, na.last = NA, depth = 1)

Arguments

x

an integer vector

na.last

NA removes NAs, FALSE puts NAs at the beginning, TRUE puts NAs at the end

depth

an integer scalar giving the number of bit-passed before switching to quicksort

Value

a sorted vector

Examples

bitsort(c(2L, 0L, 1L, NA, 2L))
bitsort(c(2L, 0L, 1L, NA, 2L), na.last=TRUE)
bitsort(c(2L, 0L, 1L, NA, 2L), na.last=FALSE)

bit documentation built on April 4, 2025, 3:09 a.m.