From hin-tak.leung at cimr.cam.ac.uk  Mon May 21 18:00:30 2007
From: hin-tak.leung at cimr.cam.ac.uk (Hin-Tak Leung)
Date: Mon, 21 May 2007 17:00:30 +0100
Subject: [Rd] readLines needs some extra bit of documentation.
Message-ID: <4651C21E.3070109@cimr.cam.ac.uk>

I have a need to use readLines to read just the first line
of a file and do some processing on that, and read and re-read
?readLines and did not see any mention of whether the actual
end-of-line character (LF, CR/LF or CR) is included as part of
the returned character vector or not.

I just tried it and and it seems that it strips the EOL characters
- so it is obvious as soon as one tries it, but I was hoping that it 
should be mentioned ?readLines (e.g. "The actual EOL character(s) are 
striped and not included as part of the returned character vector").

The reason why I was specifically looking for that information is that,
in perl, the line-input operator, <file> , returns character vectors
with the EOL included, and is opposite to that of R. I know I cannot
compare apple with orange, and R's readLines() behavior is obvious
as soon as one tries it, but an explicit sentence in the help page
would be nice...

HTL



[Rd] readLines needs some extra bit of documentation.
Hin-Tak Leung