For example:

a <- 1
f <- function(b){
    return(a+b)
}


when we call function f(2), r will search the local environment first, if
it cannot find a, it will search global environment, and return 3. How to
avoid r searching the global environment and return an error when we call
this function?

Thanks.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to