From hb at maths.lth.se  Tue May 24 22:18:25 2005
From: hb at maths.lth.se (Henrik Bengtsson)
Date: Wed May 25 20:04:59 2005
Subject: [Rd] Request: scan() argument 'allowEscapes' in read.table() too,
	please.
Message-ID: <42938C11.5040806@maths.lth.se>

I would like to suggest adding argument 'allowEscapes' to 
read.table(..., allowEscapes=TRUE) and pass it to its three calls to 
scan(..., allowEscapes=allowEscapes).

Rd (from ?scan):
\item{allowEscapes}{logical. Should C-style escapes such as '\n' be 
processed (the default) or read verbatim?   Note that if not within 
quotes these could be interpreted as a delimiter (but not as a comment 
character).}

Currently, it is not possible to use read.table() to read tab-delimited 
files with elements containing the string "\t" (not a TAB), i.e. the two 
characters "\" and "t". Example:

<file>
A	B
1	a\tb
2	c\td
</file>

<readable>
A<tab>B
1<tab>a\tb
2<tab>c\td
</readable>

Try to read the above with

scan(stdin(), what=character(0), sep="\t", allowEscapes=FALSE)

and this

scan(stdin(), what=character(0), sep="\t", allowEscapes=TRUE)

Cheers

Henrik Bengtsson


[Rd] Request: scan() argument 'allowEscapes' in read.table() too, please.
Henrik Bengtsson