gpt4 book ai didi

r - 无法在以前工作的 r 脚本中打开连接

转载 作者:行者123 更新时间:2023-12-03 17:52:25 26 4
gpt4 key购买 nike

我在 R 脚本中遇到“无法打开连接”错误。以下是详细信息:

> write.csv(table1.fiveReitWts,file="C:\\Users\\John Broussard\\Dropbox\\evtHandbookProject\\figuresTables\\figure3Data.csv")
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file 'C:\Users\John Broussard\Dropbox\evtHandbookProject\figuresTables\figure3Data.csv': No such file or directory
>

这是一个正在创建的新文件,但该目录存在。我可以看到包含其他文件的目录。我以前成功使用过此代码,但突然之间,我无法将文件写入此目录。

我可以提供哪些附加信息来帮助您解决此错误?

最佳答案

您必须对文件路径中的空格使用转义字符。我会尝试像这样写整件事:

C:/Users/John\ Broussard/Dropbox/evtHandbookProject/figuresTables/figure3Data.csv

编辑:

由于这显然不是问题的根源,也许文件是在另一个进程中打开的?
如果您复制文件并尝试打开副本怎么办?

关于r - 无法在以前工作的 r 脚本中打开连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17823638/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com