Cc: r-help@r-project.org
Subject: Re: [R] evaluating expressions with sub expressions
The following recursively walks the expression tree. The esub
function is from this page (you may wish to read that entire thread):
http://tolstoy.newcastle.edu.au/R/help/04/03/1245.html
esub - function
On Sat, Jan 30, 2010 at 10:39 AM, Jennifer Young
jennifer.yo...@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
Hallo
I'm having trouble figuring out how to evaluate an expression when one of
the variables in the expression is defined separately as a sub expression.
Here's a simplified example
mat - expression(0, f1*s1*g1) # vector of formulae
g1 - expression(1/Tm) # expansion of the definition
Hi,
Would this do as an alternative syntax?
g1 - quote(1/Tm)
mat - list(0, bquote(f1*s1*.(g1)))
vals - data.frame(f1=1, s1=.5, Tm=2)
sapply(mat, eval, vals)
HTH,
baptiste
On 29 January 2010 17:51, Jennifer Young
jennifer.yo...@math.mcmaster.ca wrote:
Hallo
I'm having trouble figuring out
Hmm
I *think* this will work, but may break in a further sub routine.
It certainly works in this example, but my expression vector is used in
many scenarios and it will take a while to check them all.
For instance, I take the derivative of each element with respect to each
variable using
The following recursively walks the expression tree. The esub
function is from this page (you may wish to read that entire thread):
http://tolstoy.newcastle.edu.au/R/help/04/03/1245.html
esub - function(expr, sublist) do.call(substitute, list(expr, sublist))
proc - function(e, env =
[mailto:r-help-boun...@r-project.org] On
Behalf Of Gabor Grothendieck
Sent: Friday, January 29, 2010 11:01 AM
To: Jennifer Young
Cc: r-help@r-project.org
Subject: Re: [R] evaluating expressions with sub expressions
The following recursively walks the expression tree. The esub
function is from this page
-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter
Sent: Friday, January 29, 2010 1:38 PM
To: 'Gabor Grothendieck'; 'Jennifer Young'
Cc: r-help@r-project.org
Subject: Re: [R] evaluating expressions with sub expressions
Folks:
Stripped
: r-help@r-project.org
Subject: Re: [R] evaluating expressions with sub expressions
The following recursively walks the expression tree. The esub
function is from this page (you may wish to read that entire thread):
http://tolstoy.newcastle.edu.au/R/help/04/03/1245.html
esub - function(expr
Inline below...
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: Friday, January 29, 2010 2:12 PM
To: Bert Gunter
Cc: Jennifer Young; r-help@r-project.org
Subject: Re: [R] evaluating expressions with sub expressions
If its good enough to have one level
10 matches
Mail list logo