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

From: Henrik Bengtsson <hb_at_maths.lth.se>
Date: Wed 09 Nov 2005 - 23:32:52 GMT


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



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Nov 10 11:19:26 2005

This archive was generated by hypermail 2.1.8 : Thu 10 Nov 2005 - 02:20:54 GMT