range_sortna {bit} | R Documentation |
Prepare for sorting and get range, number of NAs and unsortedness
Description
In one pass over the vector NA
s are treated according to parameter
na.last
exactly like sort()
does, the range()
,
number of NA
s and unsortedness is determined.
Usage
range_sortna(x, decreasing = FALSE, na.last = NA)
Arguments
x |
an integer vector |
decreasing |
(currently only |
na.last |
|
Value
an integer vector with NA
s are treated and an attribute
range_na()
with
four elements:
min integer
max integer
number of NAs
0 for sorted vector and 1 for
is.unsorted()
See Also
range_na()
and range_nanozero()
Examples
range_sortna(c(0L, 1L, NA, 2L))
range_sortna(c(2L, NA, 1L, 0L))
range_sortna(c(0L, 1L, NA, 2L), na.last=TRUE)
range_sortna(c(2L, NA, 1L, 0L), na.last=TRUE)
range_sortna(c(0L, 1L, NA, 2L), na.last=FALSE)
range_sortna(c(2L, NA, 1L, 0L), na.last=FALSE)
[Package bit version 4.6.0 Index]