Skip to content

read.table error with R 2.2.0

5 messages · Duncan Murdoch, Florence Combes, Peter Dalgaard +1 more

#
On 11/9/2005 10:07 AM, Florence Combes wrote:
There is no "read.table.default" in standard R 2.2.0, so it appears that 
you have installed a replacement for read.table, and it no longer works. 
   If you type

getAnywhere("read.table")$where

and

getAnywhere("read.table.default")$where

you are likely to see where those functions came from.  (I see

 > getAnywhere("read.table")$where
[1] "package:base"   "namespace:base"

 > getAnywhere("read.table.default")$where
character(0)

indicating that read.table comes from the base package, and 
read.table.default doesn't exist.

Duncan Murdoch
#
Florence Combes <fcombes at gmail.com> writes:
read.table is not generic in 2.2.0 and it calls 

.Internal(readTableHead(file, nlines, comment.char,
        blank.lines.skip, quote, sep))


So where did  read.table.default() come into play? Is it picking up a
version that you yourself have modified perhaps? Or are you using some
package which redefines read.table and needs to be updated for 2.2.0?

        -p

  
    
#
Florence Combes wrote:

            
Hi, author of aroma here.  This was fixed a few months ago.  From 
showHistory(aroma):
Version: 0.84 [2005-07-01]
...
o BUG FIX: GenePixData$read() would give "Error in read.table.default(...
  ...): 5 arguments passed to 'readTableHead' which requires 6".

What I have done/did is that I created a read.table.QuantArrayData() 
function, rename base::read.table() to read.table.default() and made 
read.table() generic.  This should make things rather backward 
compatible.  When I looked at my source code history, the reason for 
this was:

# 2002-08-18
# o Since the 'Measurements' section in QuantArray files seems to contain
#   rows with tailing TAB's (that just should be ignored) read.table() fails
#   to read them. read.table() is making use of scan() and scan() has the
#   argument 'flush' which flushes such trailing cells, but it is not used
#   by read.table(). For this reason I created the static read.table()
#   method of QuantArrrayData which has the 'flush' argument.

I other words, I just added the argument 'flush=FALSE' to 
read.table[.QuantArrayData]() and passes 'flush=flush' to its internal 
calls to scan().  I'll send R-devel a note and see if it is possible to 
add this argument to the default read.table().  However, everything 
should work correctly as it is now.

Cheers

Henrik