I have had several instances recently where File > Save All followed by File > Quit session has failed to save my scripts. At first I thought this was a Windows problem because I was having some windows problems at the time, but these are now resolved and the failure to save has continued to recur.
There are commonalities in the sessions where this problem happened. First, all of them began from an open session with File > Open Project in a New Session. The original, different, project remained open in its own RStudio window. Second, in each case I then opened the second project by selecting the .RProj file (st_exp.RProj). Third, although my scripts were not saved - or at least, not saved in the project directory under the name I gave them -- the History file was nearly current, and the data files, though apparently absent in the environment window, reappeared when I refreshed the view with the gear button in the upper right.
I am pretty sure it has nothing to do with my code with the code in the second project I opened, at least.
I've been able to partially reconstruct my work in each case using the history file, but it has entailed a lot of lost time and duplicated effort. Does anyone have a clue how i can prevent this from occurring? Do I just have to give up keeping two instances of R/RStudio open at the same time? One of the two projects - the originally open one in the description above - involves loading 11 GB and takes 10 to 15 minutes or so on my slow machine, so I prefer to close and reload it only occasionally.