Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching R help: Error in file(out, "wt") : cannot open the connection

Tags:

r

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

Please help me. What do I do to overcome this problem? Even googling this problem didn't give me much info.

like image 584
quipoy Avatar asked Jun 28 '16 21:06

quipoy


2 Answers

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

like image 115
Tomas Avatar answered Oct 18 '22 03:10

Tomas


Ok.Thank you all.I was able to resolve this by changing the directory and exiting R and re-logging into swirl.

like image 26
quipoy Avatar answered Sep 28 '22 09:09

quipoy