Re: [R] incomplete final line found by readLines on ...

From: Prof Brian Ripley <>
Date: Wed 05 Jul 2006 - 19:02:00 EST

readLines in R-devel has argument warn=TRUE, so you can easily change the behaviour if using that version of R.

On Fri, 30 Jun 2006, Taka Matzmoto wrote:

> Dear R-users
> I need to read some text files produced by some other software.
> I used readLines (with n = -1 ) command and then tried to find some numbers
> I liked to extract or some line numbers I like to know.
> The problem is that there is no empty line at the end of the text files.

The problem is actually that the final `line' does not end in an EOL mark (LF or CRLF as appropriate), which often indicates a broken text file.

> R gave me this warning below;
> In addition: Warning message:
> incomplete final line found by readLines on 'output.txt'
> I know this doesn't affect anything and just warning messages. Is there any
> way to prevent this warning message.
> Thanks
> Taka
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Wed Jul 05 20:22:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 05 Jul 2006 - 22:16:17 EST.

Mailing list information is available at Please read the posting guide before posting to the list.