[R] current env

Roger D. Peng rpeng at jhsph.edu
Tue Apr 6 05:15:28 CEST 2004


I think you want

f <- function() {
    data(iris, envir = environment())
}

-roger

Rafael A. Irizarry wrote:
> i want to do something like this:
> 
> f <- function(){
> 	data(iris)
> }
> 
> and have f() not leave iris in the global env. i can see there is a env
> argument in data() but i dont know what to send it so that it uses the
> current environment and not the global env.
> 
> any help appriciated.
> 
> -r
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list