is.sorted: Test if an Object is Sorted

Description Usage Arguments See Also Examples

View source: R/is_sorted.R

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) )

Example output



Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to is.sorted in Kmisc...