growth.intervals | R Documentation |
For the vector of values resulting from the evaluation of a function, this function determines the positions of the values between which the vector grows.
growth.intervals(x, y, zeroSlope = 0.01)
x |
a vector of values. |
y |
the vector of the corresponding values of a function for the |
zeroSlope |
maximum slope (in degrees) required to consider that a growing function is constant. |
The growth.intervals
function ignores the pairs of values between which the vector y
starts and stops growing if the slope is less than zeroSlope
.
This function returns NULL if the vector y
is not growing. Otherwise, the
function computes a matrix of indexes with two columns. The first column
contains the positions of the values from which the vector y
starts growing and the
second column those at which the vector y
stops growing.
Patricia Román-Román, Juan J. Serrano-Pérez and Francisco Torres-Ruiz.
u <- seq(0, 5, length = 200)
v <- sin(u)
w <- growth.intervals(u, v)
w
plot(u, v, type = "l", las = 1)
abline(v = u[as.vector(w)])
## Continuing the FPTL(.) examples:
growth.intervals(y$x, y$y)
growth.intervals(y$x, y$y, zeroSlope = 0.001)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.