[R] [R-pkgs] New package Ryacas

Gabor Grothendieck ggrothendieck at gmail.com
Tue Oct 17 02:31:39 CEST 2006


Here is a slightly shorter way to do it although it involves passing
a yacas string directly:

> yacas("a * Identity(3)")
expression(list(list(a, 0, 0), list(0, a, 0), list(0, 0, a)))
> PrettyForm("%")
/                    \
| ( a ) ( 0 ) ( 0 )  |
|                    |
| ( 0 ) ( a ) ( 0 )  |
|                    |
| ( 0 ) ( 0 ) ( a )  |
\                    /


On 10/16/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> Its pretty limited right now but you can do this:
>
> > library(Ryacas)
> > d <- List(List(1, 0, 0), List(0, 1, 0), List(0, 0, 1))
> > a <- Sym("a")
> > a * d
> expression(list(list(a, 0, 0), list(0, a, 0), list(0, 0, a)))
> > PrettyForm("%")
> /                    \
> | ( a ) ( 0 ) ( 0 )  |
> |                    |
> | ( 0 ) ( a ) ( 0 )  |
> |                    |
> | ( 0 ) ( 0 ) ( a )  |
> \                    /
>
> The ASCII representation of the matrix will look correct in R although its
> possible that the email process munges it up so it may not look right
> when you receive this.
>
> Also there are also matrix examples on the home page, in the Ryacas vignette
> and in the Ryacas-Sym vignette.
>
> Note that by mistake the vignette labelled Ryacas-Sym in the package
> itself is actually a copy of the Ryacas vignette so to see the actual
> Ryacas-Sym vignette currently one must look at the one in the source repository:
> http://ryacas.googlecode.com/svn/trunk/inst/doc/Ryacas-Sym.pdf
>
>
>
> On 10/16/06, Cleber N. Borges <cborges at iqm.unicamp.br> wrote:
> > Hello,
> >
> > First,
> > I would like to congratulations for very cool package! It's very
> > nice
> > idea!...
> > Secondly,
> > Is there a way to send R'objects (variables) to yacas and make
> > symbolic
> > operations??
> > for example:
> >
> > d <- diag(3)
> > a <- "A"
> >
> > yacas(   d * a )
> >
> > Thanks,
> > Cleber Borges
> >
> >
> > Gabor Grothendieck wrote:
> >
> > >Ryacas is an R interface to the free yacas computer algebra
> > >system.  Ryacas allows one to send R expressions,
> > >unprocessed yacas strings and certain other R objects to a
> > >separate yacas process from R and get back the result.  It
> > >also has facilities for manipulating yacas strings and R
> > >expressions destined for yacas processing.
> > >
> > >It can be used for exact arithmetic, symbolic math, ASCII
> > >pretty printing and translating R to TeX.
> > >
> > >
> > >Online info.  For overview, pointers to additional
> > >information, installation instructions and a sample session
> > >see:
> > >
> > >    http://code.google.com/p/ryacas/
> > >
> > >The vignettes can be viewed online here:
> > >
> > >    http://ryacas.googlecode.com/svn/trunk/inst/doc/Ryacas.pdf
> > >    http://ryacas.googlecode.com/svn/trunk/inst/doc/Ryacas-Sym.pdf
> > >
> > >
> > >More. Once Ryacas is installed, pointers to additional
> > >information can be found with these R commands:
> > >
> > >    library(Ryacas)
> > >    package?Ryacas
> > >
> > >
> > >---
> > >
> > >
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch 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.
> >
>



More information about the R-help mailing list