is.sorted: Test if an Object is Sorted

Description Usage Arguments See Also Examples

Description

Test if an object is sorted, without the cost of sorting it. Wrapper to is.unsorted.

Usage

1
is.sorted(x, na.rm = FALSE, strictly = FALSE)

Arguments

x

an R object with a class or a numeric, complex, character or logical vector.

na.rm

logical. Should missing values be removed before checking?

strictly

logical indicating if the check should be for strictly increasing values.

See Also

is.unsorted

Examples

1
stopifnot( is.sorted(1, 2, 4) )


Search within the Kmisc package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.