From don at delphioutpost.com  Sat May 17 18:03:22 2003
From: don at delphioutpost.com (don@delphioutpost.com)
Date: Sat May 17 17:03:33 2003
Subject: [Rd] read.table fails with \246 separator (PR#3035)
Message-ID: <200305171503.h4HF3M2b000811@pubhealth.ku.dk>

Full_Name: Don Allen
Version: 1.6.2
OS: Solaris
Submission from: (NULL) (140.186.148.11)


If you use '\246' to separate fields in a csv-like file, read.table fails if
you
have more than 5 lines in the file (in the following, the separators in junk.csv
are really '\246's, despite the way they printed):

Fails:


> read.table("/tmp/junk.csv",as.is=T,header=T,sep="\246")

Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :

	line 5 did not have 5 elements

junk.csv
----------------
xabcd
17131925
28142026
39152127
410162228
511172329
612182430
----------------

That works if you delete the last two lines:


> read.table("/tmp/junk.csv",as.is=T,header=T,sep="\246")

  x  a  b  c  d
1 1  7 13 19 25
2 2  8 14 20 26
3 3  9 15 21 27
4 4 10 16 22 28

When using tabs or vertical bars as separators, you do not encounter this
problem. The suspicion, of course, is that this has something to do with using a
separator
that has the high-order bit set (Insightful introduced just such a bug in Splus
6.1
that completely breaks their read.table for such separators).


[Rd] read.table fails with \246 separator (PR#3035)
don@delphioutpost.com