[R] automatic cleaning of workspace

Liaw, Andy andy_liaw at merck.com
Wed Nov 29 03:49:34 CET 2006


You can avoid loading .Rdata at start-up without deleting the .Rdata
file by adding the --no-restore option to the R command.  I have that,
and additionally, --no-save, in my shortcut for the Rgui.exe command.  I
use explicit save() and load() in my scripts to save objects that are
expensive to compute.

Andy

From: Leeds, Mark (IED)
> 
> I'm having that problem where I am sometimes using an object 
> that's from a previous workspace when I don't want to be 
> doing that. I was thinking of putting rm(objects=ls()) in my 
> first.R function But, the problem with doing this, is that it 
> doesn't prompt you with "are you sure" and there could be 
> very rare cases where I don't want to delete the workspace ? 
> Is there a way to make the cleaning of the workspace 
> automatic but still prompt you ? I guess I can always just 
> try to remember to manually do rm(objects=ls())when I start 
> up in whatever workspace I am in but I don't think I can 
> trust my memory. Thanks.
> --------------------------------------------------------
> 
> This is not an offer (or solicitation of an offer) to 
> buy/se...{{dropped}}
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
> 
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}



More information about the R-help mailing list