本文介绍了gzfile(文件,"wb")中的错误:无法打开连接或压缩文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行两件事:首先,我创建一个4x5的PDF,以dev.off()结尾,然后尝试创建一个新图.但是,在开始第二次绘图后,我得到:

I'm trying to run two things: first, I'm creating a PDF with 4x5, ending with dev.off(), and then trying to create a new graph. However, after starting the second plot, I get:

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

这是什么错误?该工作目录是我具有读/写访问权限的目录,并且我的硬盘驱动器未满.

What is this error? The working directory is one I have read/write access to, and my hard drive isn't full.

另外,我正在使用RStudio.

Also, I'm using RStudio.

推荐答案

这有点晚了,但是对于任何来这里寻求帮助的人,当我尝试从RStudio写入文件并且目标文件路径为很长.我意识到这可能是一个问题,因为当我将文件写入具有较短名称的另一个位置并尝试将其复制到我的原始目标位置时,Windows提示我文件路径太长"的错误.您可能需要将原始文件保存到具有较短绝对路径的其他位置.

This is a bit late but for anyone coming here for help, I got this error when I was trying to write a file from RStudio and my destination file path was very long. I realized this could be a problem because when I wrote the file to another location with a shorter name and tried to copy it into my original destination, Windows gave me an error saying "File path too long". You might need to save the original file into another location with a shorter absolute path.

这篇关于gzfile(文件,"wb")中的错误:无法打开连接或压缩文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 14:52