nyangoodye
nyangoodye

Reputation: 13

Can't read csv with quotes R

I'm trying to do dataframe from csv.

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?

Upvotes: 0

Views: 108

Answers (1)

dcarlson
dcarlson

Reputation: 11046

Your input file is corrupt. You will have to fix it to import it into R. Here are the first 8 lines:

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

Upvotes: 1

Related Questions