Re: [R] More on global environment

2004-07-17 Thread Cliff Lunneborg
k attached further down the path. The two functions move() and rm.sv() contributed by my colleague John Miyamoto and described in the above make this easy to do. Michael Prager wrote: : Date: Thu, 15 Jul 2004 14:45:41 -0400 : From: "Mike Prager" <[EMAIL PROTECTED]> : Subject: [R]

Re: [R] More on global environment

2004-07-15 Thread Uwe Ligges
Mike Prager wrote: At 7/15/2004 03:23 PM Thursday, Andy Liaw wrote: I've posted the following to R-help before. Hope it helps you. cd <- function(dir = tclvalue(tkchooseDirectory()), saveOld=FALSE, loadNew=TRUE) { stopifnot(require(tcltk)) flush.console() What you want

RE: [R] More on global environment

2004-07-15 Thread Mike Prager
At 7/15/2004 03:23 PM Thursday, Andy Liaw wrote: I've posted the following to R-help before. Hope it helps you. cd <- function(dir = tclvalue(tkchooseDirectory()), saveOld=FALSE, loadNew=TRUE) { stopifnot(require(tcltk)) flush.console() if (saveOld) save.image(compre

RE: [R] More on global environment

2004-07-15 Thread Liaw, Andy
I've posted the following to R-help before. Hope it helps you. cd <- function(dir = tclvalue(tkchooseDirectory()), saveOld=FALSE, loadNew=TRUE) { stopifnot(require(tcltk)) if (saveOld) save.image(compress=TRUE) setwd(dir) rm(list=ls(all=TRUE, envir=.GlobalEnv), envi

Re: [R] More on global environment

2004-07-15 Thread Roger D. Peng
That seems reasonable, although you might use rm(list = ls(all.names = TRUE)) if you are interested in removing objects whose names begin with a period. -roger Mike Prager wrote: To follow up on my previous question, suppose a user R session wants to unload one workspace and load another within an

[R] More on global environment

2004-07-15 Thread Mike Prager
To follow up on my previous question, suppose a user R session wants to unload one workspace and load another within an R session. Is the following the correct sequence? 1. save.image() to save the current workspace as .Rdata in the current working directory. 2. rm(list=ls()) to remove every