简体   繁体   English

文件错误(文件“ rt”)

[英]Error in file(file, “rt”)

I'm using Rstudio and I cannot open several file .txt because of this error message : 我正在使用Rstudio,由于以下错误消息,我无法打开多个文件.txt:

Error in file(file, "rt") : cannot open the connection

I enter : 我输入:

X1= read.table("fileX1.txt", header = FALSE)

I don't understand because some of my colleagues use the same function with the same .txt file and it works for them 我不明白,因为我的一些同事对相同的.txt文件使用相同的功能,并且对他们有用

Since you aren't specifying the path to the file, R will look for it in the current directory. 由于您没有指定文件的路径,因此R会在当前目录中查找它。 If that isn't the directory containing the file, you'll get that error. 如果那不是包含文件的目录,则将得到该错误。

You can use setwd() (or a menu command in RStudio) to set the current directory. 您可以使用setwd() (或RStudio中的菜单命令)来设置当前目录。 Alternatively, you could use file.choose() to get a dialog to choose the file; 另外,您可以使用file.choose()获得一个对话框来选择文件; it will return the full filename including the path. 它将返回完整的文件名,包括路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 file(file,“ rt”)R参数错误 - Error in file(file, “rt”) R arguments 文件中的错误(文件,“rt”):无法打开连接另外:警告消息:在文件(文件,“rt”)中:无法打开文件 - Error in file(file, “rt”) : cannot open the connection In addition: Warning message: In file(file, “rt”) : cannot open file 在文件(文件,“ rt”)中出现错误:无法打开连接 - Getting Error in file(file, “rt”) : cannot open the connection 文件错误(文件,“rt”):无法打开连接(寻找其他解决方案) - Error in file(file, "rt") : cannot open the connection (looking for another solution) 文件错误(文件,“rt”):无法在 r 中打开连接 - Error in file(file, “rt”) : cannot open the connection in r R闪亮:文件错误(文件,“ rt”):无效的“描述”参数 - R shiny: Error in file(file, “rt”) : invalid 'description' argument 文件(文件,“rt”)中的错误:调用函数时“描述”参数无效 - Error in file(file, "rt") : invalid 'description' argument , when calling the function 文件中出现错误(文件,“rt”):无法打开连接 - Getting error in file(file, "rt"): cannot open the connection 无法将csv读取到R Markdown中:文件错误(文件,“ rt”) - Cannot read csv into R Markdown: Error in file(file, “rt”) 文件错误(文件,“rt”):无法打开连接 - Shiny - Error in file(file, "rt") : cannot open the connection - Shiny
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM