[Roxygen-devel] [roxygen2] error sourcing the R files (probably environment issue)

Hadley Wickham hadley at rice.edu
Wed Sep 21 21:38:04 CEST 2011


> in one of the R files I have something like this, that defines a temporary
> function in order to define a static variable:
>
> f <- function(){
>    .a <- 0
>    function(x=1){
>        .a <<- .a + x
>        .a
>    }
> }
> f2 <- f()
> rm(f)
>
> When running roxygenise on this I get the error:
> Error in eval(expr, envir, enclos) : object 'f' not found

What does traceback give you?  Could you provide a small reproducible example?

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/


More information about the Roxygen-devel mailing list