evaluating expressions with sub expressions
On Sat, Jan 30, 2010 at 10:39 AM, Jennifer Young
<Jennifer.Young at math.mcmaster.ca> wrote:
handling of variables in R to be very straightforward; sometimes I pine for Maple to do my algebra for me...
There are several interfaces to Computer Algebra Systems in R. Try this (but read instructions on home page http://ryacas.googlecode.com first particularly the part about ensuring you have the right version of XML installed). Below, Sym creates a symbolic variable:
library(Ryacas)
Loading required package: XML
f1 <- Sym("f1")
s1 <- Sym("s1")
Tm <- Sym("Tm")
g1 <- 1/Tm
mat <- f1 * s1 * g1
mat
[1] "Starting Yacas!" expression(f1 * s1/Tm)