is.unsorted
From base v3.3
by Rcore Rcore@Rproject.org
Test if an Object is Not Sorted
Test if an object is not sorted (in increasing order), without the cost of sorting it.
 Keywords
 univar
Usage
is.unsorted(x, na.rm = FALSE, strictly = FALSE)
Arguments
 x
 an R object with a class or a numeric, complex, character, logical or raw vector.
 na.rm
 logical. Should missing values be removed before checking?
 strictly
 logical indicating if the check should be for strictly increasing values.
Value

A lengthone logical value. All objects of length 0 or 1 are sorted.
Otherwise, the result will be NA except for atomic vectors and
objects with an S3 class (where the >= or > method is
used to compare x[i] with x[i1] for i in
2:length(x)) or with an S4 class where you have to provide a
method for is.unsorted().
%% FIXME: rather want '>' and '>=' methods for S4 classes be sufficient
Note
This function is designed for objects with onedimensional indices, as described above. Data frames, matrices and other arrays may give surprising results. Support for raw vectors was added in R 3.1.0.
See Also
Community examples
Looks like there are no examples yet.