Re: [R] More on global environment

2004-07-17 Thread Cliff Lunneborg
You may want to look at the notes on and functions for workspace management that guide me. They can be downloaded from http://faculty.washington.edu/lunnebor/Stat342/ by checking on Exercises. I use the .GlobalEnv (position 1 on search path) solely for scratch and have project work attached

Re: [R] More on global environment

2004-07-16 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 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

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),

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)