Opening Rproject opens old scripts, including previously discarded ones

This is a duplicate of the issue previously posted by @JackFG in 2020 here:

The previous issue was automatically closed but remained unanswered and in 2024, I am still getting this problem too, despite having these options set:

In short, the project will just open a random bunch of files of coding past and present (thankfully not future), meaning I have to go through and close them all before getting on with my work. It's super annoying and I don't know how to fix it. Does anyone have any ideas how to fix it? For context, I'm in Windows 10, University computer, working on OneDrive. I mention the universtiy computer and OneDriver because there has been some discussion about admin rights/cloud services potentially corrupting RProject files, but i'm not sure that's the issue here especially as the contents of my RProject file is:

Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

Any help greatly appreciated.


Just giving this a kick to keep it alive so that it doesn't get archived like the other previous post on this issue.

its always hard to fix bugs that struggle to be reproducible. You can see a discussion of this on the official github issues page for Rstudio IDE.

Quote from the thread :

I ended up throwing away the .Ruser.proj folder which of course fixes the issue

1 Like

Thanks very much Nir! I've been able to find a workaround for this issue off the back of you pointing me to this thread, as well as share some theories off the back of this with RStudio devs which might help them develop a permanent fix for this!

Have stated it in the Github discussion but just to state the workaround explicitly here for anyone coming across this and wanting a quick solution:

Delete the .Rproj.user folder (hidden folder where project-specific temporary files e.g. auto-saved source documents, window-state, etc. are stored:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.