我想导入.csv
文件,这样我就可以随着这个视频如下: [R GGPLOT2图形直方图 。
我安装了所有正确的软件包,包括ggplot
和相关包。 在视频的第一条指令说键入afl.df=read.csv("afl_2003_2007.csv")
所以,我下载afl_2003_2007.csv
文件,我尝试了所有的下方,这基本上将在不同的目录文件(共享驱动器,则C驱动器等)。 我使用也试过setwd
,但没有运气。
我在Windows中使用R上。
下面是我试过了,我得到了错误:
> afl.df=read.csv("afl_2003_2007.csv")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'afl_2003_2007.csv': No such file or directory
> afl.df=read.csv("\\the-lab.llnl.gov\llnlusers1\lopez235\Data\Documents\Dashboards,HRBI, Visulizations and Analytics\Math and Statistics and Predictive Modeling1\R Programming\afl_2003_2007.csv")
Error: '\l' is an unrecognized escape in character string starting "\\the-lab.llnl.gov\l"
> afl.df=read.csv("C:\Users\lopez235\Local-NOTBackedUp\R Files Local\afl_2003_2007.csv")
Error: '\U' used without hex digits in character string starting "C:\U"
> setwd("\\the-lab.llnl.gov\llnlusers1\lopez235\Data\Documents\Dashboards,HRBI, Visulizations and Analytics\Math and Statistics and Predictive Modeling1\R Programming\afl_2003_2007.csv")
Error: '\l' is an unrecognized escape in character string starting "\\the-lab.llnl.gov\l"
> setwd("\\the-lab.llnl.gov\llnlusers1\lopez235\Data\Documents\Dashboards,HRBI, Visulizations and Analytics\Math and Statistics and Predictive Modeling1\R Programming")
Error: '\l' is an unrecognized escape in character string starting "\\the-lab.llnl.gov\l"
> setwd("C:\Users\lopez235\Local-NOTBackedUp\R Files Local")
Error: '\U' used without hex digits in character string starting "C:\U"