[Rd] String Length Limit (PR#1040)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Fri, 3 Aug 2001 17:50:18 +0200 (MET DST)

On Fri, 3 Aug 2001 possolo@crd.ge.com wrote:

> Full_Name: Antonio Possolo
> Version: 1.3.0
> OS: Linux
> Submission from: (NULL) (
> If one attempts to read a character string from a file using scan,
> and the string comprises more than 8190 characters, then the string
> is truncated to this length, and no warning is issued.
> I've observed this both in the Linux and Win implementations of R 1.3.0.
> S-PLUS (v. 6.0 rel. 1 for Sun SPARC0 does not suffer from this behavior.

Yes, that's an R limitation.  Why is it a problem?  I think you would
do better using readLines if it is a line-oriented file.  AFAIK that is

It would be easy to issue a warning, quite a bit harder to remove the limit
(which dates from the days when character strings were in most places
limited to 8191 chars).

Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch