[R] [R-pkgs] Ryacas now on CRAN
Gabor Grothendieck
ggrothendieck at gmail.com
Thu May 3 18:14:51 CEST 2007
Ryacas is now available on CRAN. (Previously it was
available on the Omegahat repository.)
Ryacas is an R package that provides an interface from R to
the yacas computer algebra system. It can be used for
computer algebra, exact arithmetic, ASCII pretty printing
and R to TeX output. R, yacas and Ryacas are all free
software packages distributed under the GPL version 2.
Ryacas is written in R. It uses a recursive decent
R-to-yacas translator and an XML-based OpenMath yacas-to-R
translator. yacas is run as a second process to which
R communicates via a socket interface.
There are 8 different user level interfaces
(yacas.character, yacas.expression, yacas.function,
yacas.formula, Sym objects, Expr objects, yacmode and
runYacas). Most users will primarily use Sym objects.
NEW INSTALLATION FOR WINDOWS USERS
A key change in moving to CRAN is that yacas.exe is no longer
part of the Ryacas distribution so that Windows users must
separately install yacas 1.0.63. :( Non-windows users always
had to separately install yacas. To simplify this somewhat
the yacasInstall() R command will download and install yacas from
within R on Windows:
# Windows installation procedure
install.packages("Ryacas", dep = TRUE)
library(Ryacas)
yacasInstall()
For non-windows users the installation procedure is the same as
before; namely, install yacas and then install the Ryacas R package.
yacasInstall is not available on non-Windows systems. More
installation information is available on the Ryacas home page.
LINKS
Home Page (Overview, News, Installation, Sample Session, Links, SVN)
http://code.google.com/p/ryacas/
News (on source changes; not entirely same as home page news)
http://ryacas.googlecode.com/svn/trunk/inst/NEWS
Vignette (includes many examples)
http://ryacas.googlecode.com/svn/trunk/inst/doc/Ryacas.pdf
SAMPLE SESSION
(need fixed font email viewer to view correctly)
> library(Ryacas)
>
> # algebra
>
> library(Ryacas)
> x <- Sym('x')
> (x+1) * (x-1)
expression((x + 1) * (x - 1))
> Simplify("%")
expression(x^2 - 1)
> PrettyForm("%")
2
x - 1
>
> # calculus
>
> Integrate(x+tan(x), x)
expression(x^2/2 - log(cos(x)))
>
> # exact arithmetic
>
> yacas('12/24')
expression(1/2)
>
> # ASCII pretty printing
>
> exp(-x^2)/(cos(x)+exp(x))
expression(exp(-x^2)/(cos(x) + exp(x)))
> PrettyForm("%")
/ / 2 \ \
Exp\ -\ x / /
-------------------
Cos( x ) + Exp( x )
>
> # matrix - yacas matrices are row-wise
>
> List(List(1,2),List(x,6))
expression(list(list(1, 2), list(x, 6)))
> PrettyForm("%")
/ \
| ( 1 ) ( 2 ) |
| |
| ( x ) ( 6 ) |
\ /
>
> # output TeX
>
> k <- Sym('k')
> yacas(TeXForm((x+1)^2 + k^3), retclass = 'unquote')
$\left( x + 1\right) ^{2} + k ^{3}$
>
> detach()
>
yacas was developed by Ayal Pinkus and other contributors.
Ryacas was developed by Rob Goedman, Gabor Grothendieck,
Søren Højsgaard and Ayal Pinkus. Contact Rob for Mac
issues and Gabor for all other issues.
_______________________________________________
R-packages mailing list
R-packages at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-packages
More information about the R-help
mailing list