[R] error using environment(f) <- NULL

Gabor Grothendieck ggrothendieck at gmail.com
Sat Dec 2 12:11:17 CET 2006


Try :

environment(f) <- baseenv()

There is also emptyenv() depending on what you want.

See ?baseenv



On 12/2/06, Carmen Meier <carmei3 at web.de> wrote:
> Hi To all,
> I found in the tread
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46740.html
>
> the reply for
>
> /> y <- 3 /
> /> f <- function(x) y /
> /> environment(f) <- NULL /
> /> f(1)
>
> /but this example (R 2.4.0) will cause an error:
>
> The use of the NULL environment is not longer possible (translated)
> The ?environment reports the NULL as possible.
> is there any other way now ,to get the same result
>
> Regards Carmen
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>




More information about the R-help mailing list