1

Here's an odd behavior for the data.table fread() method, after updating 1.8.1>1.9.2.

a.txt:
    "id";"Timestamp"
    "1";"2013-10-19,01:42:11"

This doesn't work:

> a <- fread("a.txt")
Error in fread("a.txt") : 
  Not positioned correctly after testing format of header row. ch=';'

Okay, so I've simplified the example this much, and I still can't figure out where my bug is!

Unescaping the id fixes it:

1;"2013-10-19,01:42:11"

Removing the id fixes it:

"2013-10-19,01:42:11"

Keeping the id escaped, and simplifying the timestamp fixes it:

"1", "2013-10-19"

So, why does this error occur? I'm stumped.

Peter O
  • 599
  • 1
  • 4
  • 18
  • For the immediate future, I just removed the ids, which weren't necessary, but a fix that I don't understand is just a band-aid. – Peter O May 02 '14 at 21:07
  • 3
    related: http://r-forge.r-project.org/tracker/index.php?func=detail&aid=5413&group_id=240&atid=975 – GSee May 02 '14 at 21:19
  • With this example, it seems like specifying `sep = ";"` also "fixes" it... – A5C1D2H2I1M1N2O1R2T1 May 03 '14 at 15:54
  • I marked this as a duplicate even though it came first because this one didn't have an answer, and you can't mark a question as a duplicate of a question that doesn't have an answer. – GSee May 24 '14 at 16:00
  • As a side note, don't take it personally that the other question got so many upvotes and yours didn't. I don't see any reason that that question is "better" -- voting on SO just doesn't make sense sometimes. – GSee May 24 '14 at 16:02

0 Answers0