[R] R: to the power

François Pinard pinard at iro.umontreal.ca
Sat Jul 16 22:49:21 CEST 2005

[Thomas Lumley]

> It would be nice if R could realize that you meant the cube root
> of -8, but that requires either magical powers or complicated and
> unreliable heuristics.  The real solution might be a function like
> root(x,a,b) to compute x^(a/b), where a and b could then be exactly
> representable integers. If someone wants to write one...

While this could be done with moderate difficulty for the simpler cases,
one cannot reasonably ask R to be and do everything. :-)

So far, I see R more on the numerical side of things.  If you want
precise, exact solutions to various mathematical problems, you might
consider installing a Computer Algebra System on your machine, next to
R, for handling the symbolic side of things.

One such system which is both free and very capable might be Maxima.
Its convoluted story is rooted 40 years in the past.  Some may say it
lacks some chrome and be mislead; don't be, the engine is pretty solid.
Peek at http://maxima.sourceforge.net if you think you need such a
beast.  Beware: to use it, you need either GCL or Clisp pre-installed.

François Pinard   http://pinard.progiciels-bpi.ca

More information about the R-help mailing list