在R语言的实践中,读入数据文件几乎是必须的操作,但没有设置好工作空间的位置,将会提示如下错误:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'Salary.csv': No such file or directory
对于读取文件的操作来说,如果采用相对路径的话,原因主要在于当前工作空间的指向不准确,最直接的办法是调用“setwd”命令,如下: