Reputation: 379
I want to launch R help, I type ?dir.create
. It is giving me this strange error:
Error in file(out, "wt") : cannot open the connection
In addition: Warning message:
In file(out, "wt") :
cannot open file 'C:\Users\XYZ~1\AppData\Local\Temp\Rtmp86bEoJ\Rtxt32dcef24de2': No such file or directory
Upvotes: 36
Views: 64757
Reputation: 59481
This happens when the temporary directory used by R is deleted. This usually happens when user or the system cleans up the tmp directory while the R session is running. Typically happens if the R session is open for a long time.
Remedy is very simple. You don't actually need to restart R. Just re-create the temporary directory by:
tempdir()
# [1] "C:\Users\XYZ~1\AppData\Local\Temp\Rtmp86bEoJ\Rtxt32dcef24de2"
dir.create(tempdir())
NOTE: this happens to me more and more often in Windows 10... even within like 8 hour session only! Not sure why this happens. See this question: https://superuser.com/questions/1502272/windows-10-cleaning-up-my-temp-dir-too-often
Upvotes: 103
Reputation: 379
Ok.Thank you all.I was able to resolve this by changing the directory and exiting R and re-logging into swirl.
Upvotes: -4