1

I was trying to read a csv file in R and read.csv gives me a warning and consequently stops reading from there on. I think it's something related to an extra quote being there. How can I resolve this?

(csv file put on a public share below for access)

> scoresdf = read.csv('http://aftabubuntu.cloudapp.net/trainDataEnglish.csv')
Warning message:
In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  EOF within quoted string
swihart
  • 2,648
  • 2
  • 18
  • 42
tubby
  • 2,074
  • 3
  • 33
  • 55
  • I'd imagine the problem has to do with encoding? Are you on Windows? You can try explicitly specifying UTF-8 encoding (the default for Windows is usually Latin-1). – MrFlick Apr 14 '15 at 05:17

2 Answers2

5

I got the same error on read.csv. I managed to get it working with the rio package:

library(rio)
dat <- import("http://aftabubuntu.cloudapp.net/trainDataEnglish.csv")

and the readr package:

library(readr)
dat <- read_csv("http://aftabubuntu.cloudapp.net/trainDataEnglish.csv")

and the data.table package:

library(data.table)
dat <- fread("http://aftabubuntu.cloudapp.net/trainDataEnglish.csv")
hrbrmstr
  • 77,368
  • 11
  • 139
  • 205
0

Try

url <- 'http://aftabubuntu.cloudapp.net/trainDataEnglish.csv'
scoresdf = read.csv(url,quote="")

As you suspected, there is indeed an embedded quotation mark somewhere within your document.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453