[R] read.table error with R 2.2.0
Henrik Bengtsson
hb at maths.lth.se
Thu Nov 10 00:15:26 CET 2005
Florence Combes wrote:
>Thanks a lot for your answer.
>In fact I found the solution, it's seems strange to me so I put it here if
>it could bu useful for other people ...
>
>I have the same as you
>
>
>>getAnywhere("read.table")$where
>>
>>
>[1] "package:base" "namespace:base"
>
>
>>getAnywhere("read.table.default")$where
>>
>>
>character(0)
>
>when I run it in a "native" R console, and the line :
>param<-read.table(file="param.dat",sep ="\t",header=TRUE,fill=TRUE,
>na.strings="NA")
>
>works very well. (I didn't test this before).
>
>
>BUT when I load the aroma package (which I need for what I want to do), then
>I have :
>
>
>>getAnywhere("read.table")$where
>>
>>
>[1] "package:aroma"
>[2] "package:base"
>[3] "registered S3 method for read from namespace base"
>[4] "namespace:base"
>
>
>>getAnywhere("read.table.default")$where
>>
>>
>[1] "package:aroma" "registered S3 method for read"
>
>and the "read.table" didn't work.
>
>So I reinstall the aroma package (even if I had the latest version) and it
>works well now).
>
>best regards,
>
>Florence.
>
>
>
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
>
>
>
>
>On 11/9/05, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>
>
>>On 11/9/2005 10:07 AM, Florence Combes wrote:
>>
>>
>>>Dear all,
>>>
>>>I just upgraded version of R to R 2.2.0, and I have a problem with a
>>>
>>>
>>script
>>
>>
>>>that did not happen with my previous version.
>>>Here is the error :
>>>
>>>-----------------------------------------
>>>
>>>
>>>>param<-read.table(file="param.dat",sep ="\t",header=TRUE,fill=TRUE,
>>>>
>>>>
>>>na.strings="NA")
>>>Erreur dans read.table.default(file = "param.dat", sep = "\t", header =
>>>TRUE, :
>>>5 arguments passed to 'readTableHead' which requires 6
>>>-----------------------------------------
>>>
>>>whereas all was OK before. I cannot understand what's happening.
>>>
>>>Has someone already encountered this ??
>>>Any help greatly appreciated,
>>>
>>>
>>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
>>
>>
>>
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
>
More information about the R-help
mailing list