[R] Deleted objects keep coming back
Adaikalavan Ramasamy
ramasamy at cancer.org.uk
Wed Jan 26 12:15:49 CET 2005
When you start you R session, see if it says
[Previously saved workspace restored]
immediately before the first command prompt.
I think the only way a workspace can be restored automatically is if you
used save.image() at some point, in which case it would save all objects
as a hidden file called ".RData".
Another way a different workspace would have been saved if it was
specified in .Rprofile, Rprofile.site. See help(Startup) for more
information about the order of files that R reads in.
On Wed, 2005-01-26 at 01:47 +0100, Peter Dalgaard wrote:
> "Ken Termiso" <jerk_alert at hotmail.com> writes:
>
> > Ah! I think this is what happened -- whenever I restarted R, it would
> > automatically load the previous workspace and its objects (call this
> > workspace 1). Then, when I would attempt to load another workspace
> > (call this workspace 2), it would retain the objects from workspace 1
> > in ADDITION to the objects loaded from workspace 2.
> >
> > If I load up R, it will say previous workspace restored. If I then
> > type >rm(list=ls()) to delete all objects, and then load another
> > workspace, it will only have the objects from the workspace I loaded...
> >
> > Am I correct here?
>
> Yes, but I think you'd be better off to learn about R's command line
> argument in particular --no-restore and --vanilla. If you're not
> starting R from the command line, I'm sure there's a way to pass
> arguments anyway...
>
>
More information about the R-help
mailing list