powered by
Determine Monotony of Vector.
get_mon(x)
1 if monotonically increasing, -1 if monotonically decreasing, otherwise, a vector of 1 or -1 indicating increasing or decreasing status
(numeric) vector
Andre Schuetzenmeister andre.schuetzenmeister@roche.com
x1 <- seq(-1, 1, .1) x2 <- seq(1, -1, -.1) y <- x1^2 / 2 + x1/3 - 5 get_mon(x1) get_mon(x2) get_mon(y)
Run the code above in your browser using DataLab