Is it safe to delete environmentTmp?


This morning after turning on my computer I noticed my hard disk had much less free space than the previous evening. When I investigated, I noticed some very large files, all called environmentTmp (no extension) in a subdirectory of .Rproj.user, had been written to the disk. The files are all about 90 GB. An example of a file is



My question: is it safe to delete these files?

I’m using Windows 10, RStudio v 1.1.383.


I would be really interested in an answer for this, too.

I have found quite a few such files (mine are just called environment) in various .Rprof.user directories. On the other hand some projects do not have these.

Are these (presumably) temporary files meant to be deleted when closing the project?


RStudio attempts to preserve the state of the global environment when the session is restarted. This implies (among other things) saving the global environment to disk. If RStudio were to crash, or if you were to kill the R process while it was attempting to shutdown / restart, it’s possible that orphaned session data could be left behind.

You should be able to safely delete these files, assuming you no longer need access to those workspaces (assuming you have the data you need saved in a separate location).