r - gzfile 中的错误(文件, "wb"): cannot open the connection or compressed file

标签 r statistics gzip

我正在尝试运行两件事:首先,我正在创建一个 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/

相关文章:

RStudio 在临时目录中从 Rmarkdown 创建 PDF 文件

r - 在 R 中计算多个数据帧的 z 分数

python - scikit-learn 和 scipy 库之间的决定系数不同。为什么?

python - 如何在使用 boto 上传到 s3 时进行 gzip

.net - 通过 WebClient.DownloadData 自动解压 gzip 响应

R:编码和解码数据?

R - 作为数字矩阵

python - 如何在 Python 中执行单尾双样本 Kolmogorov–Smirnov 检验?

node.js - Nodejs express : compression of response doesn't work

r - 如何在 R 语言中用方括号包裹 JSON?