I'm wondering
x <- 5
write to those temporary files?If temporary files are created where are they stored and what happens if I launch several instances of R.exe? Will they share and overwrite each others temporary files?
Each instance of R gets its own temporary directory. You can see that pretty easily below the default temporary directory on your system (eg /tmp
for me; on Windows I usually set TEMPDIR
and TMPDIR
to C:\TMP
and find them there; I forget where they go otherwise). But when you invoke tempfile()
or tempdir()
you can infer the path:
R> tempfile()
[1] "/tmp/RtmpDVDtmj/file6a27612c4c83"
R>
So the R session in which I typed this uses /tmp/RtmpDVDtmj/
.
The directory name is randomized and safe from other R instances running at the same time.
At exit of R, the directory is purged.
And no, the simple assignment x <- 5
will not involve a temporary file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With