Skip to content

availability of a "solve" function in R?

2 messages · Ron Shonkwiler, Achim Zeileis

#
I would like to define a function of two variables f(x,y) and, for
a given value of x, solve f(x,y)=0 for y.

Is this available in R?

ron shenk
shenk at math.gatech.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Ron Shonkwiler wrote:
Have a look at uniroot(), e.g. do something like

R> myfun <- function(x,y) x+y
R> uniroot(function(x) myfun(x,5), c(-10,10))

cheers
Z
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._