search for: efun2

Displaying 1 result from an estimated 1 matches for "efun2".

Did you mean: fun2
2011 Nov 07
1
Accessing ENVSXP and CLOSXP while processing parsed R code
...nd Statistical Computing*" ===================================================================== f<-function(){ Rmlfun<-function(x){ sumx <- sum(x) n <- length(x) function(mu) n*log(mu)-mu*sumx } efun <-Rmlfun(1:10) y1 <- efun(3) print(y1) efun2 <- Rmlfun(20:30) y2 <- efun2(3) print(y2) } ===================================================================== Now assignment efun <-Rmlfun(1:10) creates a closure where *function(mu) n*log(mu)-mu*sumx *is returned and *sumx* and *n *are added to the existing environment. I c...