View source: R/zero_crossings.R
zero_crossings | R Documentation |
Find zero crossings of a vector, i.e., indices when the numeric variable crosses 0. It is useful for finding the points where a function changes by looking at the zero crossings of its derivative.
zero_crossings(x)
find_inversions(x)
x |
A numeric vector. |
Vector of zero crossings or points of inversion.
Based on the uniroot.all
function from the rootSolve package.
x <- sin(seq(0, 4 * pi, length.out = 100))
# plot(x, type = "b")
modelbased::zero_crossings(x)
modelbased::find_inversions(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.