Unwanted paragraph breaks in TSV file

I am using Rstudio and trying to load in a txt document like so:

table <- read.table("association_test.assoc.txt",
                      as.is = "rs",header = TRUE)

However, I get this error:
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 1 did not have 9 elements

Looking at the file, there is an unwanted line break, so my data looks like this:

  1. Header; [1] [2] [3] etc...
  2. Data; [a] [b]
  3. [c]
  4. [a2] [b2]
  5. [c2]

How do I delete these unwanted line breaks, so that [a, b, c] are all on the same row, rather than on different ones?

Thank you!

This needs a reprex. See the FAQ. Just cut and paste the first ten lines of the *.txt file will do for this one.

Can you share with us the tsv using dropbox for example?

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.