emonigma
emonigma

Reputation: 4436

R restores workspace without .RData file

When I start R from a terminal, I see:

Type 'q()' to quit R.

[Previously saved workspace restored]

> 

But that directory has no .Rdata file

$ ls *.RData
ls: *.RData: No such file or directory
$ ls *.Rdata
ls: *.Rdata: No such file or directory

The problem is that functions saved in this previous workspace are in the global environment and cover functions that I defined since:

Attaching package: ‘PosteriorBootstrap’

The following objects are masked _by_ ‘.GlobalEnv’:

    anpl, get_rstan_file, load_dataset, script, stick_breaking

How can I find the location of the .Rdata file that R loads on startup? And how can I prevent R from doing this automatically in the future?

Upvotes: 0

Views: 94

Answers (1)

Konrad Rudolph
Konrad Rudolph

Reputation: 546093

The file is probably there, your command just doesn’t show it: *.RData expands to any file ending in the string .RData, except .RData itself.

Do this:

ls .RData

Upvotes: 2

Related Questions