Re: [R] evaluate one variable in an expression with two variables

2012-02-08 Thread Gabor Grothendieck
On Wed, Feb 8, 2012 at 4:02 PM, moli wrote: > I want to evaluate f with the mean=7 > >  mean=7 >  f <-  expression(-(x-mean)^2/2) > then get a new expression: > >  -(x-7)^2/2 > How could I do it? Thanks. > You can leave out the initial as.expression if you don't mind having a call object instead:

[R] evaluate one variable in an expression with two variables

2012-02-08 Thread moli
I want to evaluate f with the mean=7 mean=7 f <- expression(-(x-mean)^2/2) then get a new expression: -(x-7)^2/2 How could I do it? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/evaluate-one-variable-in-an-expression-with-two-variables-tp4370877p4370877.html Sent fr