Select Page

Curious read.table v read.csv error

May 11, 2015

For some reason read.table loads a small csv file without any problems. I don’t recall now the size at which it starts barfing, but as I go higher in the file size, same 311 dataset, I start getting a missing element error. I was able to load all 1.8 million rows using read.csv and a few random (well, not random in the strict sense) checks show it to have loaded fine, no missing elements.  This error is related to the read.table command (function?) not the dataset itself, because let’s say the first try results in an error in line X,  I examine line X, and the requisite number of elements are present and there are no quotes or comments. I abstract a few hundred lines on either side of X and read.table loads the dataset just fine. Try loading the full  file starting at line X+1, and another line throws up the same error. Am a noob at this, but from I recall, read.csv is built on read.table and simply includes the comma and header arguments without them having to be specified.

Have to come back to this later with forensic hat on, but if someone reading this who knows what’s going on – please use the comments or email me! First four letters of my handle moved to after the second four, at gmail.

About The Author

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.