Learn R Programming

VFP (version 1.4.4)

get_mon: Determine Monotony of Vector.

Description

Determine Monotony of Vector.

Usage

get_mon(x)

Value

1 if monotonically increasing, -1 if monotonically decreasing, otherwise, a vector of 1 or -1 indicating increasing or decreasing status

Arguments

x

(numeric) vector

Author

Andre Schuetzenmeister andre.schuetzenmeister@roche.com

Examples

Run this code
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