[R] How to delete the previously saved workspace restored

2,826 views
Skip to first unread message

Yanwei Tan

unread,
May 31, 2010, 5:10:34 AM5/31/10
to r-h...@r-project.org
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"

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.

With many thanks for any advice!!

Best,
Wei

______________________________________________
R-h...@r-project.org 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.

David Winsemius

unread,
May 31, 2010, 8:49:02 AM5/31/10
to Yanwei Tan, r-h...@r-project.org

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

Joris Meys

unread,
May 31, 2010, 10:04:41 AM5/31/10
to Yanwei Tan, r-h...@r-project.org
If you start R, type :

unlink(".RData")

This deletes the workspace file.
Cheers
Joris

--
Joris Meys
Statistical Consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

Coupure Links 653
B-9000 Gent

tel : +32 9 264 59 87
Joris...@Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

[[alternative HTML version deleted]]

jim holtman

unread,
May 31, 2010, 10:12:25 AM5/31/10
to Joris Meys, r-h...@r-project.org, Yanwei Tan
The easiest way (I use WIndows) is to start each session without
loading the previous workspace. I explicitly save what I need and
then explicitly restore it. In most cases, I always reconstruct the
data I need.

I use the '--no-restore --no-save' options.

--
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

Yanwei Tan

unread,
May 31, 2010, 9:15:16 AM5/31/10
to David Winsemius, r-h...@r-project.org
Thanks a lot David!

I use MacOSX and deleted the .RData file, then everything is fine.

Best wishes,
Wei


On 5/31/10 2:49 PM, David Winsemius wrote:
>
> 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
>
>

______________________________________________

Reply all
Reply to author
Forward
0 new messages