我正在尝试运行两件事:首先,我正在创建一个 4x5 的 PDF,以 dev.off() 结尾,然后尝试创建一个新图形。但是,在开始第二个情节后,我得到:
Error in gzfile(file, "wb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "wb") :
cannot open compressed file '/var/folders/n9/pw_dz8d13j3gb2xgqb6rfnz00000gn/T/RtmpTfm1Ur/rs-graphics-822a1c83-b3fd-46c3-8028-4e0778f91d0c/4db4b438-ac35-403b-b791-e781baba152c.snapshot', probable reason 'No such file or directory'
Graphics error: Error in gzfile(file, "wb") : cannot open the connection
这是什么错误?工作目录是我有读/写访问权限的目录,而我的硬盘驱动器未满。
另外,我正在使用 RStudio。
最佳答案
这有点晚了,但是对于任何来这里寻求帮助的人来说,当我尝试从 RStudio 写入文件并且我的目标文件路径很长时,我遇到了这个错误。我意识到这可能是一个问题,因为当我将文件写入另一个名称较短的位置并尝试将其复制到我的原始目的地时,Windows 给了我一个错误,提示我“文件路径太长”。您可能需要使用较短的绝对路径将原始文件保存到另一个位置。
关于r - gzfile 中的错误(文件, "wb"): cannot open the connection or compressed file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15363076/