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:

A       B
1       a\tb
2       c\td


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)


Henrik Bengtsson

R-devel@stat.math.ethz.ch mailing list

Reply via email to