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. 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
[Taka Matzmoto]>Is there any way to prevent [this] warning message.Hi, Taka. The easiest might be using the suppressWarnings wrapper. See ?suppressWarnings for more information. -- Fran?ois Pinard http://pinard.progiciels-bpi.ca
Prof Brian Ripley
2006-Jul-05 09:02 UTC
[R] incomplete final line found by readLines on ...
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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595