[R] availability of a "solve" function in R?

Achim Zeileis zeileis at ci.tuwien.ac.at
Sat Sep 22 14:40:21 CEST 2001


Ron Shonkwiler wrote:
> 
> 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?

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
 
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list