简体   繁体   English

无法读取带有引号 R 的 csv

[英]Can't read csv with quotes R

I'm trying to do dataframe from csv.我正在尝试从 csv 做 dataframe。

d <- read.csv('out.csv', quote = "\"")

But it's don't see my quotes and return me this但它没有看到我的报价并返回给我这个

1                                                                                     0  27     3    173   46               07.09.2010     57        22
2                                                                                     1  27     3    168   46    Кунцевская 05.07.2010     65        30
3     2,25.0,4.0,165.0,52.0,"Кутузовская, Студенческая, Киевская",24.10.2016,52.0,223.0  NA    NA     NA   NA                              NA        NA
4                                                                                     3  21     2    170   42 Тимирязевская 25.10.2006     60        22
5                                                                                     4  35     4    180   46 Проспект Мира 27.12.2010     70        52
6 5,32.0,2.0,176.0,46.0,"Белорусская, Савеловская, Новослободская",07.09.2011,60.0,15.0  NA    NA     NA   NA                              NA        NA

How may I fix this?我该如何解决这个问题?

Your input file is corrupt.您的输入文件已损坏。 You will have to fix it to import it into R.您必须修复它才能将其导入 R。 Here are the first 8 lines:以下是前 8 行:

idc,Age,Boobs,Height,Size,Metro,DateUpdate,Weight,Price_USD
0,27.0,3.0,173.0,46.0,,07.09.2010,57.0,22.0
1,27.0,3.0,168.0,46.0,Кунцевская,05.07.2010,65.0,30.0
"2,25.0,4.0,165.0,52.0,""Кутузовская, Студенческая, Киевская"",24.10.2016,52.0,223.0"
3,21.0,2.0,170.0,42.0,Тимирязевская,25.10.2006,60.0,22.0
4,35.0,4.0,180.0,46.0,Проспект Мира,27.12.2010,70.0,52.0
"5,32.0,2.0,176.0,46.0,""Белорусская, Савеловская, Новослободская"",07.09.2011,60.0,15.0" 
"6,23.0,2.0,175.0,44.0,""Тургеневская, Красные ворота, Курская"",14.02.2011,49.0,22.0"

Notice that lines 4, 7, and 8 begin with quotation marks.请注意,第 4、7 和 8 行以引号开头。 The commas inside quotation marks are ignored.引号内的逗号将被忽略。 The ends of those lines are also surrounded by quotation marks so the individual values are lumped together.这些行的末端也用引号括起来,因此各个值集中在一起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM