R语言将数据框写入CSV文件时连接错误的解决方法
R语言write.csv写入CSV时"无法打开连接"错误的解决方法
执行write.csv(data, "data.csv")将数据框导出为CSV文件时,触发以下错误:
write.csv(data, "data.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 'torg_acq_view1.csv': Invalid argument
解决方法
在执行写入文件的命令前,先运行closeAllConnections()关闭所有已打开的连接,示例代码如下:
closeAllConnections() write.csv(data, "data.csv")
内容的提问来源于stack exchange,提问作者KOs
相关产品推荐
相关产品推荐

