[R] How to permanently remove [Previously saved workspace restored]

Duncan Murdoch murdoch.duncan at gmail.com
Sun Nov 14 17:43:18 CET 2010


On 14/11/2010 10:42 AM, Joshua Wiley wrote:
> On Sun, Nov 14, 2010 at 3:40 AM, Stephen Liu<satimis at yahoo.com>  wrote:
>> Hi Joshua,
>>
>>> list.files(path = getwd(), all.files = TRUE)
>>   [3]
>> ".RData"
>>   [4]
>> ".Rhistory"
>> .Rhistory and .RDate are there.
>
> Note that these files start with a "."
>
>>
>> But I can't find .RDate on Windows Explorer.  Only .Rhistory is there.
>
> This is likely a "feature" of Windows Explorer....certain types of
> files are hidden by default (like those that start with ".").

That's not true:  it's Unix ls that hides filenames starting with a ".". 
  Windows Explorer does hide some files, but I don't think it is ever 
based on the name, it's based on the attributes.

What Windows Explorer does that is incredibly stupid is that (by 
default) it hides file extensions for known file types.  Generally 
".RData" will be registered as a known file type.  Exporer will cut off 
the ".RData" part the name of a file with that extension, and only show 
the first part of the name.  Since the file ".RData" has no starting 
part of a name, it will be listed with a blank name.

What you should do (and what Microsoft should set the default to) is to 
turn off this bad policy of listing filenames incorrectly.  I don't 
remember how to do it in Windows 7 or Vista, but on XP, here's how:

Go into Explorer in some folder.

Click on the "Tools" menu, then the "Folder Options..." choice.

Choose the View tab.

About 10 choices down within Files and Folders, you'll see "Hide 
Extensions for Known File Types".  Make sure this is *not* checked.

If you're sane, you'll then click on the button "Apply to all folders", 
but you might just want to click on "OK" to try it out on one folder first.

Duncan Murdoch






  You can
> adjust this behavior in the folder options (if the idea of
> protected/hidden files and folder options all sounds new to you, now
> is a great opportunity to spend some time exploring your operating
> system, learning how it works and how to use it at a more serious
> level than the basic user it assumes....Google is your friend here,
> there are literally thousands of articles, walkthroughs, and tutorials
> on different aspects of Windows).
>
>>> rm (list = ls(all=TRUE))
>
> This does NOT delete the workspace, it just clears your worksapce of
> any objects.
>
>>> q()
>> save working image
>
> Now you will have saved your current worksapce (which if you just used
> rm() as above, will be empty, but still there).
>>
>> On next start of R
>> [Previously saved workspace restored]
>> still popup
>
> Now you probably just restored an empty workspace.  This is not a
> problem, it is normal R behavior and is a sign that everything is
> working as expected.
>
>>
>>
>> B.R.
>> Stephen L
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list