On Tue, May 11, 2004 at 04:31:21PM +0200, Perez Martin, Agustin wrote:
> For example:
>
> a<-expression(exp(-x^2))
> b<-expression(exp(x^2))
>
> And I want to calculate:
>
> a*b
Use
t<-2
expression(a, list(x=t))*expression(b, list(x=t))
I am not sure what you are using these for, but maybe you could also
use functions --- more convenient for calculations. Eg
a <- function(x) { exp(-x^2) }
b <- function(x) { exp(x^2) }
a(x)*b(x) # =1
For evaluating the same functions many times, see ?sapply and the
related pages.
Best,
Tamas
--
Tam??s K. Papp
E-mail: tpapp at axelero.hu
Please try to send only (latin-2) plain text, not HTML or other garbage.