Low-level sorting: counting sort
In one pass over the vector NA
s are handled according to parameter
na.last
by range_sortna
, then, if the vector is unsorted,
counting sort is invoked.
countsort(x, na.last = NA)
x |
an integer vector |
na.last |
|
a sorted vector
countsort(c(2L,0L,1L,NA,2L)) countsort(c(2L,0L,1L,NA,2L), na.last=TRUE) countsort(c(2L,0L,1L,NA,2L), na.last=FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.