Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

purpose of .RDataTmp temporary file? [R]

Tags:

r

what is the purpose of the R temporary file that is created in every directory where a workspace is saved? What data does it contain and is it safe to delete?

like image 256
Herman Toothrot Avatar asked Aug 19 '15 14:08

Herman Toothrot


People also ask

What is the tmp file in R?

Temporary files are automatically removed at the end of each R session that ends normally. You can use tmpFiles to see the files in the current sessions, including those that are orphaned (not connect to a SpatRaster object any more) and from other (perhaps old) sessions, and remove all the temporary files.

Can I delete R temp files?

To delete the local temporary files follow the below steps: Step 1: Press Windows key + R to open the Run command. Then type “%temp%” in the search field and press OK. Step 2: Now, select all local temp files using ctrl + A and then press delete.


1 Answers

That file is a holding file for save.image() while R waits for its file argument to succeed. From help(save.image) and its safe argument -

safe - logical. If TRUE, a temporary file is used for creating the saved workspace. The temporary file is renamed to file if the save succeeds. This preserves an existing workspace file if the save fails, but at the cost of using extra disk space during the save.

So the file contains the entire workspace image and it is probably best to just leave it there in case R fails to save the workspace normally.

I'm also guessing that if you see this file, R has already failed to rename the file so you may want to search for file and check its contents before deleting the temporary file.

like image 52
Rich Scriven Avatar answered Sep 28 '22 12:09

Rich Scriven