Re: [R] Wish list: add an "until" or "EOF.marker" parameter to scan & rea dLines

About this list Date view Thread view Subject view Author view Attachment view

From: ripley@stats.ox.ac.uk
Date: Sat 28 Dec 2002 - 01:08:37 EST


Message-id: <Pine.LNX.4.31.0212271402580.7298-100000@gannet.stats>

Why is this necessary? There are plenty of ways to do this already via
connections, e.g copy line-by-line to an anonymous file connection and
then scan from that.

Yes, it is useful, and that's why people already supplied you with a more
general tool, namely connections. Please do look at the internals of scan
before suggesting complicating it further: it is already close to
unmaintainable.

I don't think R-help is the place for wishlist items: there is R-devel and
the R-bugs list has a wishlist section too (but please note that this gets
little action due to the perceived usefulness of the wishes).

On Fri, 27 Dec 2002 Mark.Bravington@csiro.au wrote:

> A bit late for Santa, but on my wish-list nevertheless:
>
> is there any chance that "scan" and "readLines" could be extended to take a
> parameter "until" or "EOF.marker", which would be a character string that
> (if encountered while reading) would cause the reading to stop, just as if
> an end-of-file had been found? [But leaving a connection open, so that
> subsequent calls could read the rest of the file.] Compatibility could be
> ensured by making "until" default to as.character( NA), which can never be
> encountered. If the "until" string isn't encountered when reading, then
> reading continues until a real end-of-file (or the "n" parameter is
> satisfied).
>
> This would be useful in all sorts of contexts; one example is in processing
> a single data file that's made up of multiple segments each of different
> formats.
>
> cheers
> Mark
>
> *******************************
>
> Mark Bravington
> CSIRO (CMIS)
> PO Box 1538
> Castray Esplanade
> Hobart
> TAS 7001
>
> phone (61) 3 6232 5118
> fax (61) 3 6232 5012
> Mark.Bravington@csiro.au
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-help@stat.math.ethz.ch mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jun 2004 - 09:31:59 EST