Re: [Rd] R can't source() long lines (PR#10383)

From: <martin.kober_at_gmail.com>
Date: Tue, 30 Oct 2007 11:20:13 +0100 (CET)


On 10/30/07, Prof Brian Ripley <ripley_at_stats.ox.ac.uk> wrote:
> This is as documented in ?source, and so is not a bug.
Indeed. You are of course correct, sorry I missed that.

What still remains is that dump() creates a file that won't source, without warning or stopping (since the output is basically useless). Note that ?dump states that "A warning is issued if it is likely that problems will arise" (in different context, but still).

Best Regards

> On Tue, 30 Oct 2007, martin.kober@gmail.com wrote:
>
> > Full_Name: Martin Kober
> > Version: 2.6.0
> > OS: Vista & Linux
> > Submission from: (NULL) (137.208.185.169)
> >
> >
> > Hi!
> >
> > I just stumbled upon a problem with file source()ing:
> >
> > R will fail to source a file if it contains lines longer than about 8192 bytes
> > ("input buffer overflow").
> >
> > While it's save to say that human-written code won't contain lines that long,
> > dump()ed data structures may reasonably contain strings longer than that (as in
> > my case).
> >
> > What's more, R will happily help you to create such files:
> >
> > x = paste(rep("12345678", 1024), collapse="")
> > dump("x")
> > source("dumpdata.R") ## this fails (on Linux & Vista)
> >
> > I'm now using save/load, which is probably better in that case anyway.
> > Still, I would be nice if source() worked or at least dump() would break
> > lines to avoid this issue.
>
> It would be even nicer if users read the documentation rather than
> expected the developers to do so for them.
>
> > Best regards,
> > Martin Kober
> >
> > ______________________________________________
> > R-devel_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> --
> 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
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 30 Oct 2007 - 10:57:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 31 Oct 2007 - 12:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.