Optimization-Related Functions
Sequence based functions, involving indices (or intervals) of minima or maxima.
which.mins (x, ..., ret.type="I", endpoints=FALSE) which.maxs (x, ..., ret.type="I", endpoints=FALSE) which.opts (x, ..., ret.type="I", endpoints=FALSE) mins (x, ..., intervals.ok=FALSE, endpoints=FALSE) maxs (x, ..., intervals.ok=FALSE, endpoints=FALSE) opts (x, ..., intervals.ok=FALSE, endpoints=FALSE)
x |
An integer/numeric vector. |
intervals.ok |
Logical, if true, optimal regions are allowed, if false (and there are optimal regions), an error is generated. |
ret.type |
String, either: |
endpoints |
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 ret.type="I", the solutions need to be single indices.
Otherwise, an error is generated.
When ret.type="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 ret.type="intervals" which returns a two-column integer matrix and ret.type="MP" which returns a numeric vector.
The mins and maxs functions return values from the original vector.
They may contain duplicated values.
Sequence Properties
(Other than unique-related properties).
x <- c (2, 1, 0, 1, 2, 1, 0, 1, 2) which.mins (x) mins (x)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.