Re: [Rd] [External] readChar() could read the whole file by default?

2024-01-26 Thread luke-tierney--- via R-devel
On Fri, 26 Jan 2024, Michael Chirico wrote: I am curious why readLines() has a default (n=-1L) to read the full file while readChar() has no default for nchars= (i.e., readChar(file) is an error). Is there a technical reason for this? I often[1] see code like paste(readLines(f), collapse="\n")

[Rd] readChar() could read the whole file by default?

2024-01-26 Thread Michael Chirico
I am curious why readLines() has a default (n=-1L) to read the full file while readChar() has no default for nchars= (i.e., readChar(file) is an error). Is there a technical reason for this? I often[1] see code like paste(readLines(f), collapse="\n") which would be better served by readChar(), esp