我正在尝试读取位于以下路径中的文本文件.如果我从长目录中读取文件,我会收到错误..但如果我将文件放在C下,它运行正常.谁能告诉我如何从以下目录路径读取表格?
> data1 <-read.table("C:\\Documents and Settings Administrator\\My Documents\\My Dropbox\\data1.txt", sep="\t", header=TRUE)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'C:\Documents and Settings Administrator\My Documents\My Dropbox\data.txt': No such file or directory
> data1 <-read.table("C:\\data1.txt",sep="\t",header=TRUE)
>
Run Code Online (Sandbox Code Playgroud)
你几乎肯定错过了一个分隔符
C:\\Documents and Settings Administrator\\My Documents\\My Dropbox\\data1.txt
Run Code Online (Sandbox Code Playgroud)
它应该读
C:\\Documents and Settings\\Administrator\\My Documents\\My Dropbox\\data1.txt
Run Code Online (Sandbox Code Playgroud)
我认为这是问题,而不是空间.