[英]Error in file(file, “rt”) : cannot open the connection In addition: Warning message: In file(file, “rt”) : cannot open file
I am very new to R and hoping that someone can help me out.我对 R 很陌生,希望有人能帮助我。 I run this code and I keep getting the cannot open the connection error.
我运行此代码并不断收到无法打开连接错误。 I set the directory to the folder I saved the data in and even checked with
file.existis("file_Path/filename")
and I got True
.我将目录设置为我保存数据的文件夹,甚至使用
file.existis("file_Path/filename")
进行检查,我得到了True
。 Yet, I still get this error.然而,我仍然得到这个错误。 Please help me: Here is the first part of the Code:
请帮助我:这是代码的第一部分:
daphnia=function(dr="c")
{
da=read.csv(paste(dr,":Data_Path/filename",sep=""))
}
Usually, this error means that the filepath is incorrect.通常,此错误意味着文件路径不正确。 Can you print out the entire path, ie
print(paste(dr,":Data_Path/filename",sep="")
? Sometimes there is an issue of using \
instead of /
as well. Is it possible you need C:/Data_Path/filename
?你能打印出整个路径,即
print(paste(dr,":Data_Path/filename",sep="")
吗?有时也会出现使用\
而不是/
的问题。您是否可能需要C:/Data_Path/filename
?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.