[Rd] Request: read.table() - argument 'flush' to be passed to scan()

Henrik Bengtsson hb at maths.lth.se
Thu Nov 10 00:32:52 CET 2005


Hi,

would it be possible to add an argument 'flush' to read.table(), which 
is passed as internal scan(..., 'flush=flush') calls?

BACKGROUND:
The microarray image analysis software QuantArray, sometimes generates 
tab-delimited files that contain data rows with trailing and obsolete 
TAB's (for unknown reasons).  Then number of TABs are unknown on before 
hand, and may vary.  These files do have a header, which defines the 
number of "target/wanted" columns.

SOLUTION:
If one add 'flush=FALSE' to the list of arguments and passes 
'flush=flush' to the "data <- scan(..., flush=flush)" call, that is, the 
scan call that reads the data table, files like the above can be read 
correctly.

 From ?scan, we have:

   flush: logical: if 'TRUE', 'scan' will flush to the end of the line
          after reading the last of the fields requested. This allows
          putting comments after the last field, but precludes putting
          more that one record on a line.

Removing the last sentence, this would be in line with the above 
suggestion. 

Is this a wanted update to read.table()?  Comments?

Cheers

Henrik



More information about the R-devel mailing list