Jestem nowy w R i próbuję dowiedzieć się, jak zaimportować plik CSV, aby śledzić wraz z tym wideo: R ggplot2 Graphics Histograms.Początkujący użytkownik próbuje dowiedzieć się, jak zaimportować prosty plik CSV do R
Zainstalowałem wszystkie odpowiednie pakiety, w tym ggplot
i powiązane pakiety. Pierwsza instrukcja na wideo mówi o typie afl.df=read.csv("afl_2003_2007.csv")
Więc pobrałem plik afl_2003_2007.csv i wypróbowałem wszystkie poniższe, które zasadniczo zawierały plik w różnych katalogach (wspólny dysk, a następnie c dysk ...). Próbowałem też używać setwd
i nie miałem szczęścia.
wyjaśnienie: Używam R w oknach
Proszę o pomoc. Dan
co starałem a błędy I GOT:
> 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"
Użyj przednich ukośników lub podwójnych np.e \\\\ zamiast \\, \\ zamiast \. \ in string jest postacią ucieczki. – Hansi
Użyj a/zamiast \ dla okien. – Justin
Zemsta Billa Gatesa, 20 lat później. –