search for: rmlfun

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

Did you mean: gmlfun
2011 Nov 07
1
Accessing ENVSXP and CLOSXP while processing parsed R code
...ive front-end for R, I had a question about accessing the closures and environments in R code. Here's the function taken and modified a little from "*Lexical Scope and 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) } =================================================================...