0

I am trying to read a tab delimited file in R and getting following error. I have more than 2 million records in file but its extracting only 1.2 million records.

Warning message: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : EOF within quoted string

2 Answers 2

2

As you indicate yourself the problem lies in the fact that ' are recognized as quotes, and this will cause R to interpret anything between this and the next quotation mark as on character string. See also here for a longer explanation. The easy solution is to disable quoting altogether using quote = "".

For future reference, please check earlier posts first, since the same solution was given in this SO post.

0

I read the file in notepad++ and it was reading it correctly. Finally, I tried removing all prime symbols (') from the text file using notepad++ and it worked for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.