whichMonotonic: Extract a part of a vector that is monotonically increasing or decreasing
Description
Extract a part of a vector that is monotonically increasing or decreasing. This function will go to the anchor value and extract the neighbor values that are monotonically increasing or decreasing.
Usage
whichMonotonic(vec, ord=NULL, anchor=NULL)
Arguments
vec
The target vector to be extracted
ord
The names of each element of the vector to be attached
anchor
The position of the element to be anchored. The default value is the middle position.