I am trying to import a .tab file into R but one of the rows has an unexpected number of elements which gives me an error.
data <- read.table(functions.tab, header = F, sep = "\t")
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 397 did not have 4 elements
What is the best way around this so I don't lose any information? Is there a way to merge the overflow elements into the last column?
We can use the
fill
argument inread.table
for rows that have less number of elements to be filled byNA