In read.table(): incomplete final line found by readTableHeader In read.table(): incomplete final line found by readTableHeader r r

In read.table(): incomplete final line found by readTableHeader


As explained by Hendrik Pon,The message indicates that the last line of the file doesn't end with an End Of Line (EOL) character (linefeed (\n) or carriage return+linefeed (\r\n)).

The remedy is simple:

  • Open the file
  • Navigate to the very last line of the file
  • Place the cursor the end of that line
  • Press return/enter
  • Save the file

so here is your file without warning

df=read.table("C:\\Users\\Administrator\\Desktop\\tp.csv",header=F,sep=";") df    V1               V2               V3               V4               V5               V6               V7               V8               V9              V101 Date 20/12/2013 09:04 20/12/2013 09:08 20/12/2013 09:12 20/12/2013 09:16 20/12/2013 09:20 20/12/2013 09:24 20/12/2013 09:28 20/12/2013 09:32 20/12/2013 09:362    1           1,3631           1,3632           1,3634           1,3633            1,363           1,3632           1,3632           1,3632           1,36293    2          0,83407          0,83408          0,83415          0,83416          0,83404          0,83386          0,83407          0,83438          0,834724    3           142,35           142,38           142,41            142,4           142,41           142,42           142,39           142,42            142,45    4           1,2263          1,22635          1,22628          1,22618          1,22614          1,22609          1,22624          1,22643           1,2265

But i think you should not read in this way because you have to again reshape the dataframe,thanks.


I faced the same problem while creating a data matrix in notepad.So i came to the last row of data matrix and pressed enter. Now i have a "n" line data matrix and a new blank line with cursor at the starting of "n+1" line.Problem solved.


I had the same problem with .xls files.My solution is to save the file as a tab delimited .txt. Then you can also manually change the .txt extension to .xls, then you can open the dataframe with read.delim.

This is very rude way to overcome the issue anyway.