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

About this list Date view Thread view Subject view Author view Attachment view

From: Achim Zeileis (zeileis@ci.tuwien.ac.at)
Date: Sat 22 Sep 2001 - 22:40:21 EST


Message-id: <3BAC86B5.104FA6AE@ci.tuwien.ac.at>

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@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@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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Thu 17 Jan 2002 - 11:10:06 EST