«Нераспознанный переход в строке символов» при попытке прочитать CSV-файл.

Я пытаюсь импортировать файл .csv, чтобы я мог следить за этим видео:R ggplot2 Graphics Histograms .

Я установил все необходимые пакеты, включая ggplotи связанные с ним пакеты. В первой инструкции в видео сказано ввести afl.df=read.csv("afl_2003_2007.csv")

. Итак, я скачал файл afl_2003_2007.csvи перепробовал все нижеприведенные действия, в основном помещая файл в разные каталоги (на общий диск, затем на диск C и т. д. ). Я также пытался использовать setwd, но безуспешно.

Я использую R в Windows.

Вот что я пробовал, и ошибки, которые я получил:

> 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"

9
задан nbro 8 May 2018 в 15:26
поделиться