You could have googled "R solve equation", and would have easily reached

http://r.789695.n4.nabble.com/R-solve-equation-td882585.html

and would have in there found something like this:

> z <- matrix(c(-8.313,-1,1), ncol=1)
> polyroot(z)
[1]  3.42626+0i -2.42626+0i
> p<-polyroot(z)
> p^2-p
[1] 8.313+0i 8.313+0i

On 27.07.2012, at 12:30, Paul Smith wrote:

> On Thu, Jul 26, 2012 at 9:48 PM, Diviya Smith <diviya.smith@gmail.com> wrote:
>> Hi there,
>> 
>> I would like to solve a simple equation in R
>> 
>> a^2 - a = 8.313
>> 
>> There is no real solution to this problem but I would like to get an
>> approximate numerical solution. Can someone suggest how I can set this up?
> 
> Since your equation is a quadratic one, why do not you use the formula
> to obtain its roots?
> 
> You can find the formula at:
> 
> http://en.wikipedia.org/wiki/Quadratic_equation
> 
> Paul
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


	[[alternative HTML version deleted]]

