[R] How to delete the previously saved workspace restored

David Winsemius dwinsemius at comcast.net
Mon May 31 14:49:02 CEST 2010


On May 31, 2010, at 5:10 AM, Yanwei Tan wrote:

> Dear all,
>
> I am a new user of R, here I have a question about remove the  
> previous restored workspace.  I saved the workspace last time, but R  
> always automatically load the workspace when I open it.  I try to  
> remove the object and then close R without saving. But next time  
> when I open R, it always load the previous workspace. I want to  
> delete the .RData in the directory, but I have no clue where is  
> the .RData directory.
>
> The message is "Workspace restored from /Users/wei/.RData"

It tells you that it is in the /Users/wei/ directory.

>
> How could I avoid from this directory? because there is a dot  
> before, I do not know where I can find this file.
>
> Also I already try this command : rm(list=ls())   But R still load  
> the previous workspace.

What OS? MacOSX? You can turn on showing dotted files which are by  
default hidden. Or you could open a Terminal window and issue the  
command

  rm /Users/wei/.RData

You could alternatively exit and save after rm(list=ls()) which would  
create an empty workspace which should load very quickly.

>
> With many thanks for any advice!!
>
> Best,
> Wei


-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list