[R] restrict namespace inside functions?

Vivek Rao rvivekrao at yahoo.com
Fri Apr 8 16:50:22 CEST 2005


Is there a way to exclude from the namespace all
variables other than function arguments and local
variables? For example, I would like the following
code
 
a = 2.0
mult <- function(x)
{
   pi = 3.14
   return(pi*a*x)
}
print(mult(10.0))

to say "a not found" rather than using a = 2.0 inside
function mult. Thanks.
 
Vivek Rao




More information about the R-help mailing list