[R] Evaluation of global variables in function definitions

H. Dieter Wilhelm dieter at duenenhof-wilhelm.de
Tue Oct 7 08:45:59 CEST 2014


Hello (),

I'd like to do the following

a <- 3
f1 <- function (x){
 a*x^2
}

a <- 5
f2 <- function (x){
 a*x^2
}

plotting f1, f2, ...

but f1 and f2 are the same, how can I evaluated the variables in the
function definition?

Thank you
      Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany



More information about the R-help mailing list