read.table ignores first 5 lines (PR#1885)

Liaw, Andy andy_liaw@merck.com
Thu, 08 Aug 2002 08:02:44 -0400


Prof. Ripley,

In that case, is it possible to check for such things and give an error in
read.table?  (Or perhaps warn against such misuse in the help file...)

Regards,
Andy

> -----Original Message-----
> From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk]
> Sent: Wednesday, August 07, 2002 4:26 PM
> To: Russell-Lenth@uiowa.edu
> Cc: r-devel@stat.math.ethz.ch; R-bugs@biostat.ku.dk
> Subject: Re: read.table ignores first 5 lines (PR#1885)
> 
> 
> stdin() from a terminal is not a file, nor is it a standard 
> connection.
> So this is not really a bug.
> 
> In particular, as used by you it does to have pushback.
> 
> On Wed, 7 Aug 2002 Russell-Lenth@uiowa.edu wrote:
> 
> > Full_Name: Russ Lenth
> > Version: 1.5.0
> > OS: Windows
> > Submission from: (NULL) (128.255.25.236)
> >
> >
> > If you use read.table with a connection to stdin(), the first
> > 5 lines of input seem not to be accepted.  See examples below.
> > Did NOT have the same problem with scan().
> >
> > > version
> >         _
> > platform i386-pc-mingw32
> > arch     i386
> > os       mingw32
> > system   i386, mingw32
> > status
> > major    1
> > minor    5.0
> > year     2002
> > month    04
> > day      29
> > language R
> >
> > > read.table(stdin(),head=T) -> junk
> > 1: a b c
> > 1: 1 2 3
> > 1: 4 5 6
> > 1: 7 8 9
> > 1: 10 11 12
> > 1: 13 14 15
> > 2: 16 17 18
> > 3: 19 20 21
> > 4: 22 23 24
> > 5:
> > > junk
> >    a  b  c
> > 1 13 14 15
> > 2 16 17 18
> > 3 19 20 21
> > 4 22 23 24
> >
> > > read.table(stdin()) -> junk
> > 1: 1 2 3
> > 1: 4 5 6
> > 1: 7 8 9
> > 1: 10 11 12
> > 1: 13 14 15
> > 1: 16 17 18
> > 2: 19 20 21
> > 3: 22 23 24
> > 4:
> > > junk
> >   V1 V2 V3
> > 1 16 17 18
> > 2 19 20 21
> > 3 22 23 24
> >
> > > junk <- scan()
> > 1: 4
> > 2: 5
> > 3: 6
> > 4: 7
> > 5: 8
> > 6: 9
> > 7:
> > Read 6 items
> >
> > > junk <- scan(stdin())
> > 1: 4
> > 2: 5
> > 3: 6
> > 4: 7
> > 5: 8
> > 6: 9
> > 7:
> > Read 6 items
> >
> >
> > 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-
> > 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
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
>

-- 
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._