View source: R/rootfinding_optimization.R
has_uniroots | R Documentation |
uniroots
was successfulDetermine whether result(s) of uniroots
was successful
has_uniroots(x, tol = .Machine[["double.eps"]]^0.25)
x |
An object returned from |
tol |
A numeric value. The convergence tolerance. |
A logical value or a vector of logical values.
r1 <- uniroots(
f = function(x) -1 + x^2,
xlim = c(-10, 10),
expected_nroots = 2
)
has_uniroots(r1)
r2 <- uniroots(f = function(x) -1 + x^2, xlim = c(-10, -5))
has_uniroots(r2)
r3 <- uniroots(f = function(x) Inf, xlim = c(-10, -5))
has_uniroots(r3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.