Description Usage Arguments Details Value See Also Examples
Sequence based functions, involving indices (or intervals) of minima or maxima.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | which.mins (v, ..., what="I", ends=FALSE)
which.maxs (v, ..., what="I", ends=FALSE)
which.opts (v, ..., what="I", ends=FALSE)
which.level (v, ..., what="intervals")
which.decreasing (v, ..., what="intervals")
which.increasing (v, ..., what="intervals")
which.nondecreasing (v, ..., what="intervals")
which.nonincreasing (v, ..., what="intervals")
which.nonlevel (v, ..., what="intervals")
mins (v, ..., allow.intervals=FALSE, ends=FALSE)
maxs (v, ..., allow.intervals=FALSE, ends=FALSE)
opts (v, ..., allow.intervals=FALSE, ends=FALSE)
|
v |
An integer/numeric vector, with length two or more. |
allow.intervals |
Logical, if true, optimal sections (which two or more equal values) are allowed, if false and there are optimal sections, an error is generated. |
what |
String, either: |
ends |
Logical vector, of length one or two, to include the first/last values as possible optima. |
... |
Ignored. |
These functions are designed to find indices or subintervals matching a pattern.
When what="I", the solutions need to be single indices.
Otherwise, an error is generated.
(Note that "I" is not allowed, for the which.level function).
When what="intervals" the functions return the starting and ending indices of intervals.
For other return types, a single index is returned for each interval.
All "which" functions return an integer vector, which the exception of what="intervals" which returns a two-column integer matrix and what="XMP" which returns a numeric vector.
The mins and maxs functions return values from the original vector.
They may contain duplicated values.
Unique-Related Functions
Sequence Properties
(Other than unique-related properties).
Other Sequence Functions
1 2 3 | x <- c (2, 1, 0, 1, 2, 1, 0, 1, 2)
which.mins (x)
mins (x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.