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

2024-01-29 Thread Duncan Murdoch
On 29/01/2024 1:09 p.m., Toby Hocking wrote: My opinion is that the proposed feature would be greatly appreciated by users. I had always wondered if I was the only one doing paste(readLines(f), collapse="\n") all the time. It would be great to have the proposed, more straightforward way to read t

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

2024-01-29 Thread Toby Hocking
My opinion is that the proposed feature would be greatly appreciated by users. I had always wondered if I was the only one doing paste(readLines(f), collapse="\n") all the time. It would be great to have the proposed, more straightforward way to read the whole file as a string: readChar("my_file.tx

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")