Skip to navigation

Archive for November, 2013

Reading recalcitrant csv files in R (line n did not have m elements)

Tuesday, November 26th, 2013

Trying to read.csv() or read.table() a csv file in R caused some headaches. In particular, I got: line 14 did not have 98 elements It turns out in this instance it was some (unqouted) string entries containing a double-quoted word. The solution was: read.table(“file.csv”,quote=””, …) Recently, I had the same problem due to inconsistent line […]