read.table ignores first 5 lines (PR#1885)
Russell-Lenth@uiowa.edu
Russell-Lenth@uiowa.edu
Wed, 7 Aug 2002 21:17:41 +0200 (MET DST)
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._