[R] Question about looking up names

Ross Boylan ross at biostat.ucsf.edu
Wed Jun 4 01:43:55 CEST 2003


On Tue, 2003-06-03 at 16:34, Robert Gentleman wrote:

> Also, note that you can get the effect of lexical scope by doing
> things like
> 
Do you mean "you can get the effects of dynamic scope...."?

>  f<- function(x) x+y
>  e1 <- new.env()
>  assign("y", 10, env=e1)
>  environment(f) <- e1
> 
> #now like lexical scope; you can futz with f's environment, assigning,
> # modifying as you like
> 


P.S. Thanks to everyone who responded.  So fast!




More information about the R-help mailing list