newton_root | R Documentation |
Returns roots of a focal function by checking the sign change in each step.
newton_root(func, step, ...)
func |
the function for which the root is sought. |
step |
a vector containing the step values |
... |
optional arguments to be passed to "func" |
a vector which containing root values
f = function(x,y){return(x*x-y*x)}
ans = newton_root(f, seq(-2,2,length=1001),y=1.333)
#ans == c(0.000,1.333)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.