Can anyone please tell me how can use save.image() function if it is placed 
within a function (i.e. some level up from the base level environment)? Here I 
experimented with following codes:


#rm(list=ls())
fn <- function() {
    x <- rnorm(5)
    save.image("f:/dat.RData")
  }
fn()

However I see that, the object fn() is actually stored in dat.RData file, not 
that "x". I have gone through the help page and saw there is some argument 
named "envir"
My question is if I need to supply some value against that argument, then what 
should be the name of the required environment?

Additionally is there any option to see the hierarchy of different environments 
at my current R session?

Thanks,

______________________________________________
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