[R] More on global environment

Mike Prager Mike.Prager at noaa.gov
Thu Jul 15 20:45:41 CEST 2004

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 everything from the workspace.
3.  setcwd("xxx") to set the new working directory.
4.  load(".Rdata") to load the new workspace.

Michael Prager, Ph.D.
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516

More information about the R-help mailing list