[R] Solving a simple linear equation using uniroot give error object 'x' not found

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Tue Oct 6 23:30:37 CEST 2020


On Tue, 6 Oct 2020 15:00:59 +0000
"Sorkin, John" <jsorkin using som.umaryland.edu> wrote:

> Colleagues,
> I am trying to learn to use uniroot to solve a simple linear
> equation. I define the function, prove the function and a call to the
> function works. When I try to use uniroot to solve the equation I get
> an error message, Error in yfu n(x,10,20) : object 'x' not found.
> 
> I hope someone can tell we how I can fix the problem
> 
>   if(!require(rootSolve)){install.packages("rootSolve")}
>   library(rootSolve)

Others have told you how to solve your problem.  I am curious to know
why on earth you are loading the rootSolve package.  The uniroot()
function is in package "stats" which is automatically available.

<SNIP>

cheers,

Rolf Turner

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-help mailing list