I have a text file with an id
and name
column, and I'm trying to read it into a data frame in R:
d = read.table("foobar.txt", sep="\t")
But for some reason, a lot of lines get merged -- e.g., in row 500 of my data frame, I'll see something like
row 500: 500 Bob\n501\tChris\n502\tGrace
[So if my original text file has, say, 5000 lines, the dimensions of my table will only end up being 1000 rows and 2 columns.]
I've had this happen to me quite a few times. Does anyone know what the problem is, or how to fix it?
500
andBob
are not separated by a tab. – Jonathan Chang