[Rd] R 2.1.1: read.table processes C-style escapes (PR#8037)

Gordon Smyth smyth at wehi.edu.au
Wed Jul 27 10:55:02 CEST 2005


At 05:21 PM 27/07/2005, Prof Brian Ripley wrote:
>On Wed, 27 Jul 2005, Gordon Smyth wrote:
>
>>Thanks for the reply. Apologies for checking only R patched rather than 
>>R-devel.
>>
>>I guess that this means that someone must have a use for 
>>allowEscapes=TRUE when read reading a file in table format into a data 
>>frame. It is hard to imagine.
>
>Octal and hex escapes are a common way to cope with different encodings.

Thanks.

>I would not want R limited by the imagination of a single user, let alone 
>a Windows-only user.

Oct and hex escapes are not the only uses of backslashes in the computing 
world, and not only in Windows. TeX markup is one example. In the 
bioinformatics world, a great variety of ways are used to represent gene 
annotation information in text files, some of them including backlashes. I 
find that people find ways to throw all sorts of things at my code.

If 'allowEscapes=FALSE' was the default in read.table, then all legacy code 
using read.table() would continue to behave as in the past. With 
'allowEscapes=TRUE', all code ever written which uses read.table(), and 
which has to cope with backslashes which are not octal or hex escapes, will 
now be broken. This is not in any sense a complaint, nor a wish that R 
should remain static or be limited by my imagination. Just a plea that, 
other things being equal, not breaking legacy code will be a consideration.

Gordon



More information about the R-devel mailing list