相关疑难解决方法(0)

尝试读取CSV文件时"字符串中无法识别的转义"

我正在尝试导入一个.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 …
Run Code Online (Sandbox Code Playgroud)

import r

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

import ×1

r ×1